<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>html2text??</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">

<style type="text/css">
ins  {text-decoration:none;}
</style>

<script type="text/javascript">
function html2text(str)
{
var h2t = str.replace(/(<([^>]+)>)/ig,""); 
return(h2t);
}
</script>

</head>
<body>
<font size=5>G&auml;stebuch</font> Code:<a href="http://baseportal.de/cgi-bin/baseportal.pl?show=/bei123/Demo/javascript_adds/html2text">$_link</a><br><br>

<button style="font-size:10px" onClick=(document.getElementById("TEST").innerHTML=document.getElementById("W1").innerHTML+document.getElementById("V1").innerHTML)>Neu Eintragen</button><br>
<ins id="V1" style="display:none"><br><button style="font-size:10px" onClick=(document.getElementById("OUTER").innerHTML="",document.getElementById("TEST").innerHTML="")>Abbruch</button><button style="background:transparent;border:0" onClick=(document.getElementById("OUTER").innerHTML=html2text(document.getElementById("TEXT").value).replace(/\n/g,"&lt;br&gt;"),document.getElementById("SHOWOUTER").style.display="block")><font size=1>Vorschau<br>ohne Tags<br></font><img src="http://bei123.de/pix/home-page-red.gif"></button><button onClick=(document.getElementById("TEXT").value=document.getElementById("DEMO").value)>Insert:<b>Demo</b>-Text</button></ins>

<ins id="TEST"></ins>
<div id="SHOWOUTER" style="background:#e0e0e0;position:absolute;z-index:1;top:40px;left:5px;width:900px;height:330px;display:none"><button onClick=(document.getElementById("SHOWOUTER").style.display="none")>Close</button><br><ins id="OUTER"></ins></div>
<ins id="W1" style="display:none"><textarea onFocus=(this.style.backgroundColor="#f0f0f0") onBlur=(this.style.backgroundColor="transparent") id="TEXT" style="font-size:11px;width:600px;height:150px;background:transparent;font-family:arial"></textarea></ins>
<br>
<br>

<perl>
#################################

sub html2text 
{##  entfernt html-tags und gibt nur Text ohne HTML zurück
my $html=$_[0];
($text = $html) =~ s/<(\/|!)?[-.a-zA-Z0-9]*.*?>//g;
return($text);
}##


#------ mal testen
$text=qq(Das ist eine <i>Perl</i>-<b>Demo</b> mit Link und Title <a href="http://bei123.de" title="gehe zu <baseportal>">baseportal</a>);

outl $text;

outl qq(<textarea id="DEMO" style="width:880px;height:35px;font-size:12px" readonly  >).convert_html($text).qq(</textarea>);

#------- sub testen
$h2t_text=&html2text($text);
outl "<h3>Mit Perl:</h3>Bearbeitet mit <i>sub html2text</i> : ebenfalls mit <b>FEHLER</b> im <font color=green>title Attribut</font> ";
outl qq(<textarea id="h2t" style="width:880px;height:35px;font-size:12px" readonly  >).convert_html($h2t_text).qq(</textarea>);
#################################
</perl>

</body>
</html>