I'm using FreeTextBox editor to get some HTML created by users.
The problem with this is this editor is not converting special chars in HTML entities at exception of "<>". I cannot use theHTML = Server.HtmlEncode(theHTML)
, because it converts all the HTML including tags and parameters, and I don't want to create an unfinishable list of theHTML.Replace
lines.
Is there any other function or method available to convert to html entities but only outside tags?
After searching a lot, I've found that I was using the wrong property of the FreeTextBox component. The property was ConvertHtmlSymbolsToHtmlCodes wich has to be true.
It also helps to use FormatHtmlTagsToXhtml if you need to insert your code into XHTML pages, because it uses a strong validation with tags parameters and quotes surrounding them.