Quantcast
Channel: htmlagilitypack Forum Rss Feed
Viewing all articles
Browse latest Browse all 655

New Post: Sanitizing string issue

$
0
0
I'm using HtmlAgilityPack to sanitize user entered rich text and strip any harmful/unwanted text. Problem occurs though when a simple text is also treated as html node

If I enter
a<b, c>d
and try to sanitize it, the output generated is
a<b, c="">d</b,>

The code I used was
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(value);
// Sanitizing Logic

var result = doc.DocumentNode.WriteTo();
I tried to set different parameters on HtmlDocument ('OptionCheckSyntax', 'OptionAutoCloseOnEnd', 'OptionWriteEmptyNodes') but nothing worked. Is this is a known issue or any workaround possible?

Viewing all articles
Browse latest Browse all 655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>