Thema: Delphi HTML Tags entfernen

Einzelnen Beitrag anzeigen

Benutzerbild von knolli
knolli

Registriert seit: 22. Sep 2006
Ort: Zittau
83 Beiträge
 
Delphi 7 Enterprise
 
#13

Re: HTML Tags entfernen

  Alt 16. Jan 2008, 19:23
ok funktioniert soweit...

aus dem quelltext

kommt das raus:
XML-Code:
@import url("./formIE.css");






Delphi-PRAXiS :: HTML Tags entfernen




if ( 0 ) { window.open('privmsg.php?mode=newpm', '_phpbbprivmsg', 'HEIGHT=225,resizable=no,WIDTH=400'); }

//-->






function openDPWindow(docURL, wndName, wndWidth, wndHeight, posLeft, posTop)

{

var session_id = '43861d35d1712e67c427884297b7a05b';


if (!posLeft)

var posLeft = (screen.width - wndWidth) / 2;

if (!posTop)

var posTop = ((screen.height - wndHeight) / 2)-20;


docURL = docURL.replace( '[SID]', session_id );


var parameters = "width="+wndWidth+",height="+wndHeight+",left="+posLeft+",top="+posTop+",
dependent=no,menubar=no,location=no,resizable=yes,scrollbars=yes,status=no";

window.open(docURL, wndName, parameters );

}

//-->





var L_EXPANDTEXT = "aufklappen";

var L_COLLAPSETEXT = "zusammenfalten";

var clpHeight = "123px";



function toggle(elementId, allowToggle) {

var srcId, srcImage, srcLink = null;


if (allowToggle=='0') return false;


srcId = document.getElementById(elementId + "_code");

srcImage = document.getElementById(elementId + "_image");

srcLink = document.getElementById(elementId + "_link");


if (srcId != null)

srcId.style.height = (srcId.style.height=="") ? clpHeight : "";


if (srcImage != null && srcId != null)

srcImage.src = (srcId.style.height==clpHeight) ? './images/common/plus.png' : './images/common/minus.png';


if (srcLink != null)

{

txt = (document.documentElement) ? srcLink.firstChild.nodeValue : srcLink.innerText;

txt = (srcId.style.height==clpHeight) ? L_EXPANDTEXT : L_COLLAPSETEXT;

if (document.documentElement)

srcLink.firstChild.nodeValue = txt;

else

srcLink.innerText = txt;

}


//

// Im Beitragseditor muessen die DHTML-Elemente neu angeordnet werden,

// wenn wir getoggelt haben. Dazu stellt der Editor die Methode

// "doRealignEditorElemets" bereit. Wenn diese Methode existiert, dann

// muss sie jetzt aufgerufen werden.

if ( window.doRealignEditorElemets ) {

doRealignEditorElemets();

}


return false;

}


function selectAll(elementId) {

var element = document.getElementById(elementId);

if ( document.selection ) {

var range = document.body.createTextRange();

range.moveToElementText(element);

range.select();

} else

if ( window.getSelection ) {

var range = document.createRange();

range.selectNodeContents(element);

var blockSelection = window.getSelection();

blockSelection.removeAllRanges();

blockSelection.addRange(range);

} else {

alert( 'Dein Browser unterstützt diese Funktion leider nicht.' );

}

return false;

}


var init_toggle = 0;

var init_linenumbers = 0;

//-->



window.name = 'wndDelphiPRAXiSMain';

















Site-Map

Suchen

Code-Library

Mailbox


Logout[knolli]

































var dpSearchURL = "http://www.delphipraxis.net/search.php";


function post_time_edit(topic_id, post_id) {

window.open("./edit_post_time.php?t="+topic_id+"&p="+post_id, '_postedittime', 'HEIGHT=200,WIDTH=500,resizable=no,scrollbars=no');

}


//-->
















Titel:-->HTML Tags entfernen

Ein Delphi (Win32)-Thema von knolli.


Vorheriges Thema anzeigen|Nächstes Thema anzeigen

Avatare einblenden





sdrucken" border="0" hspace="2" vspace="2">









Delphi-PRAXiS Forum - Übersicht->Object-Pascal / Delphi-Language




Seite 1 von 1[ 10 Beiträge ]












Autor

Nachricht













knolli


#1|Verfasst am:Heute um 11:53Titel:HTML Tags entfernen











MitgliedStatus:onlineBeiträge: 9angemeldet: 22.09.2006

Sprache: Delphi (Win32) Hi!





Ich melde mich nun schon wieder mit einem euene Problem.


Mir geht es darum, alle HTML-Tags zu entfernen, damit ich nur noch z.B.: Linkbeschriftungen oder den auf der Seite
sichtbaren Text habe und diesen bearbeiten kann. Wer kann mir sagen, wie das funktionieren könnte? Wohlgemerkt es soll alles mit delphi passieren^^.




Ich freue mich schon auf eure Hilfe und hoffe das ich mir auch selbst eine Antwort geben kann!











*] -->



test -->

























DeddyH


#2|Verfasst am:Heute um 11:59Titel:Re: HTML Tags entfernen











"Rüsselmops" ;-)Alter: 41Status:onlineBeiträge: 3.281angemeldet: 17.09.2006Wohnort: Schweina/ThüringenDelphi 7 Enterprise


Ein Anfang wäre, alle < zu ermitteln und von deren Position bis zum folgenden > alles zu löschen.



Gruß Deddy


21 ist nur die halbe Antwort








*] -->


test -->


























tr909


#3|Verfasst am:Heute um 12:04Titel:Re: HTML Tags entfernen











MitgliedStatus:offlineBeiträge: 145angemeldet: 05.11.2004Turbo Delphi für Win32

Hatte gerade das gleiche Problem und habe nu provisorisch erst mal folgendes gebastelt und zusammengesucht



Delphi-Quellcode:    zusammenfalten | markieren

ace: nowrap; width: 100%; overflow-x: auto; overflow-y: auto; overflow: auto;">
1&middot;&middot;&middot;5&middot;&middot;&middot;&middot;10&middot;&middot;&middot;&middot;15&middot;&middot;&middot;
&middot;20&middot;&middot;&middot;&middot
;25&middot;&middot;&middot;&middot;30&middot;&middot;&middot;&middot;35[/b]
&middot;&middot;&middot;&middot;40&middot;&middot;&middot;&middot;45&middot;&middot;&middot;&middot;50&middot;&middot;
&middot;&middot;55&middot;&middot;&middot;&middot;60&middot;&middot;&middot;&middot;65&middot;&middot;&middot;&middot;
70&middot;&middot;&middot;&middot;75&middot;&middot;&middot;&middot;80&middot;&middot;&middot;&middot;85&middot;&middot;
&middot;&middot;

0;">90&middot;&middot;&middot;&middot;95&middot;&middot;&middot;&middot;100&middot;&middot;&middot;&middot;105&middot;
&middot;&middot;&middot;110&middot;&middot;&middot;&middot;115&middot;&middot;&middot;&middot;120&middot;&middot;&middot;
&middot;125&middot;&middot;&middot;&middot;130&middot;&middot;&middot;&middot;135&middot;&middot;&middot;&middot;140&middot;
&middot;&middot;&middot;

180&middot;&middot;&middot;&middot;185&middot;&middot;&middot;&middot;190191function GiveSZ(HCode: string): Char;



var


 i : Integer;



begin


 Result := ' ';


 if (HCode = '&amp;quot;') or (HCode = '&quot;') then Result := '&quot;';



 if (HCode = '&amp;amp;') or (HCode = '&amp;') then Result := '&amp;';



 if (HCode = '&amp;lt;') or (HCode = '<') then Result := '<';



 if (HCode = '&amp;gt;') or (HCode = '>') then Result := '>';



 // ISO 160 bis ISO 255 Codes


 if (HCode = '&amp;nbsp;') or (HCode = ' ') then Result := ' ';



 if (HCode = '&amp;iexl;') or (HCode = '&iexcl;') then Result := '&iexcl;';



 if (HCode = '&amp;cent;') or (HCode = '&cent;') then Result := '&cent;';



 if (HCode = '&amp;pound;') or (HCode = '&pound;') then Result := '&pound;';



 if (HCode = '&amp;curren;') or (HCode = '&curren;') then Result := '&curren;';



 if (HCode = '&amp;yen;') or (HCode = '&yen;') then Result := '&yen;';



 if (HCode = '&amp;brkbar;') or (HCode = '&brvbar;') then Result := '&brvbar;';



 if (HCode = '&amp;sect;') or (HCode = '&sect;') then Result := '&sect;';



 if (HCode = '&amp;uml;') or (HCode = '&uml;') then Result := '&uml;';



 if (HCode = '&amp;copy;') or (HCode = '&copy;') then Result := '&copy;';



 if (HCode = '&amp;ordf;') or (HCode = '&ordf;') then Result := '&ordf;';



 if (HCode = '&amp;laquo;') or (HCode = '&laquo;') then Result := '&laquo;';



 if (HCode = '&amp;not;') or (HCode = '&not;') then Result := '&not;';



 if (HCode = '&amp;shy;') or (HCode = '&shy;') then Result := '&shy;';



 if (HCode = '&amp;reg;') or (HCode = '&reg;') then Result := '&reg;';



 if (HCode = '&amp;hibar;') or (HCode = '&macr;') then Result := '&macr;';



 if (HCode = '&amp;deg;') or (HCode = '&deg;') then Result := '&deg;';



 if (HCode = '&amp;plusmn;') or (HCode = '&plusmn;') then Result := '&plusmn;';



 if (HCode = '&amp;sup2;') or (HCode = '&sup2;') then Result := '&sup2;';



 if (HCode = '&amp;sup3;') or (HCode = '&sup3;') then Result := '&sup3;';



 if (HCode = '&amp;acute;') or (HCode = '&acute;') then Result := '&acute;';



 if (HCode = '&amp;micro;') or (HCode = '&micro;') then Result := '&micro;';



 if (HCode = '&amp;para;') or (HCode = '&para;') then Result := '&para;';



 if (HCode = '&amp;middot;') or (HCode = '&middot;') then Result := '&middot;';



 if (HCode = '&amp;cedil;') or (HCode = '&cedil;') then Result := '&cedil;';



 if (HCode = '&amp;sup1;') or (HCode = '&sup1;') then Result := '&sup1;';



 if (HCode = '&amp;ordm;') or (HCode = '&ordm;') then Result := '&ordm;';



 if (HCode = '&amp;raquo;') or (HCode = '&raquo;') then Result := '&raquo;';



 if (HCode = '&amp;frac14;') or (HCode = '&frac14;') then Result := '&frac14;';



 if (HCode = '&amp;frac12;') or (HCode = '&frac12;') then Result := '&frac12;';



 if (HCode = '&amp;frac34;') or (HCode = '&frac34;') then Result := '&frac34;';



 if (HCode = '&amp;iquest;') or (HCode = '&iquest;') then Result := '&iquest;';



 if (HCode = '&amp;Agrave;') or (HCode = '&Agrave;') then Result := '&Agrave;';



 if (HCode = '&amp;Aacute;') or (HCode = '&Aacute;') then Result := '&Aacute;';



 if (HCode = '&amp;Acirc;') or (HCode = '&Acirc;') then Result := '&Acirc;';



 if (HCode = '&amp;Atilde;') or (HCode = '&Atilde;') then Result := '&Atilde;';



 if (HCode = '&amp;Auml;') or (HCode = '&Auml;') then Result := '&Auml;';



 if (HCode = '&amp;Aring;') or (HCode = '&Aring;') then Result := '&Aring;';



 if (HCode = '&amp;AEling;') or (HCode = '&AElig;') then Result := '&AElig;';



 if (HCode = '&amp;Ccedil;') or (HCode = '&Ccedil;') then Result := '&Ccedil;';



 if (HCode = '&amp;Egrave;') or (HCode = '&Egrave;') then Result := '&Egrave;';



 if (HCode = '&amp;Eacute;') or (HCode = '&Eacute;') then Result := '&Eacute;';



 if (HCode = '&amp;Ecirce;') or (HCode = '&Ecirc;') then Result := '&Ecirc;';



 if (HCode = '&amp;Euml;') or (HCode = '&Euml;') then Result := '&Euml;';



 if (HCode = '&amp;Igrave;') or (HCode = '&Igrave;') then Result := '&Igrave;';



 if (HCode = '&amp;Iacute;') or (HCode = '&Iacute;') then Result := '&Iacute;';



 if (HCode = '&amp;Icirce;') or (HCode = '&Icirc;') then Result := '&Icirc;';



 if (HCode = '&amp;Iuml;') or (HCode = '&Iuml;') then Result := '&Iuml;';



 if (HCode = '&amp;ETH;') or (HCode = '&ETH;') then Result := '&ETH;';



 if (HCode = '&amp;Ntilde;') or (HCode = '&Ntilde;') then Result := '&Ntilde;';



 if (HCode = '&amp;Ograve;') or (HCode = '&Ograve;') then Result := '&Ograve;';



 if (HCode = '&amp;Oacute;') or (HCode = '&Oacute;') then Result := '&Oacute;';



 if (HCode = '&amp;Ocirc;') or (HCode = '&Ocirc;') then Result := '&Ocirc;';



 if (HCode = '&amp;Otilde;') or (HCode = '&Otilde;') then Result := '&Otilde;';



 if (HCode = '&amp;Ouml;') or (HCode = '&Ouml;') then Result := '&Ouml;';



 if (HCode = '&amp;times;') or (HCode = '&times;') then Result := '&times;';



 if (HCode = '&amp;Oslash;') or (HCode = '&Oslash;') then Result := '&Oslash;';



 if (HCode = '&amp;Ugrave;') or (HCode = '&Ugrave;') then Result := '&Ugrave;';



 if (HCode = '&amp;Uacute;') or (HCode = '&Uacute;') then Result := '&Uacute;';



 if (HCode = '&amp;Ucirc;') or (HCode = '&Ucirc;') then Result := '&Ucirc;';



 if (HCode = '&amp;Uuml;') or (HCode = '&Uuml;') then Result := '&Uuml;';



 if (HCode = '&amp;Yacute;')
java und der ganze rest muss auch raus... ich brauche nur das was wirklich auf der seite steht...

[edit=mkinzler]Zeilenumbrüche eingefügt Mfg, mkinzler[/edit]
  Mit Zitat antworten Zitat