This project has moved and is read-only. For the latest updates, please go here.

Code suggestion: Override ToString() in HtmlDocument

Topics: Developer Forum
Feb 15, 2012 at 9:20 PM

I had to do some digging to figure out how to save the modified HTML document as a string, and I've seen a few other posts on the web asking the same question. It would be great if you could provide this as an override to ToString() to make it a bit more intuitive.

I had emailed Simon about this, but didn't get a response. If the powers that be think this suggestion is a bad idea for some reason, that's fine, just let me know. I'd like to contribute more to this project as well, but I want to make sure it's still active.


for HtmlDocument.cs

       /// <summary>
       /// Outputs the HTML document to a string
       /// </summary>
       /// <returns>A string representation of the HTML document</returns>
       public override string ToString()
           return DocumentNode.OuterHtml;