I have a C# application that receives an html file. I want to parse and validate it. On output it will return a list of errors or that my html is valid.
Has anyone any idea how can I do this?
The World Wide Web Consortium provide a simple online tool (https://validator.w3.org/) that automatically check your HTML code and point out any problems/errors your code might have, such as missing closing tags or missing quotes around attributes.
An HTML validator is a quality assurance program used to check Hypertext Markup Language ( HTML ) markup elements for syntax errors. A validator can be a useful tool for an HTML user who receives data electronically from a variety of input sources.
I'd run a local instance of the W3C Markup Validation service and communicate with it via the API
You can use HTML Tidy. There is a wrapper for .NET called TidyManaged
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With