remove html tags from text

Hi,

I need to remove html tags from a text string.

In other solutions, I use the getAsPlainText method in combination with a hidden text field (html area) on a form.

But this solution runs as a batch server, so I guess I can not use this “trick” there ?

Regards,

You can use a regular expression:

var _plainText = _htmlText.replace(/<\/{0,1}\w+>/g, "");

Thanks,

But in my sample it still leaves the ** ** in the text.

Maybe there are more issues like that one ??

Googled some extra info and now I use this :

data.replace(/<\/{0,1}\w+>/g,'').replace(/&[^;]+?;/g,''

Why don’t you try the SmartDoc plugin? (Overview - SmartDoc Plugin - ServoyForge)

The part of the SmartDoc that does the extraction is Tika. But the SmartDoc does more than extracting text. It might be too much just for this. But if were you I’d check it out. I am sure that you’ll find it very useful - it also can serve you well in many other solutions.

JC