You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdebindings/kjsembed/docs/examples/html2text/html2text_plugin.js

20 lines
397 B

function html2text( html )
{
var text = html.replace( /<[^>]*>/g, '' );
text = text.replace( /&quot;/g, '"' );
text = text.replace( /&lt;/g, '<' );
text = text.replace( /&amp;/g, '&' );
return text;
}
function text2html( text )
{
var html = text.replace( /&/g,"&amp;");
html = html.replace( /"/g,"&quot;");
html = html.replace( /</g,"&lt;");
return html;
}