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

New Post: Make HtmlNode.WriteTo virtual

$
0
0
We have a CMS with rich editor. The editor is inserting special HTML elements that serve as placeholders for videos, audios, images or blocks of text. We are migrating from regular expression to HAP to detect these elements. Intended workflow is like this:
  1. Load the document via HAP
  2. Detect special placeholders in the document and replace them with custom HtmlNode-derived objects
  3. Split the document array of objects of two kinds - HTML and special
In order to do this I'm calling HtmlDocument.Save passing special TextWriter-derived class. I need special HtmlNode-derived class to interact with special TextWriter-derived class in a special way (it basically closes one underlying StringBuilder, creates special placeholder object and starts a new StringBuilder). In order to do this I need HtmlNode.WriteTo to be virtual, so I can override it.
I made it virtual for myself and compiled a custom version of HAP. But it'd be nice if this change is done to official HAP, so we can use it from NuGet.

Thanks

Viewing all articles
Browse latest Browse all 450

Trending Articles