Every html document is an xml document. In the current project there are a lot of html tags which are not properly closed. This is a ruby on rails application. I want to put an after filter which will parse the whole html output and will raise an error if the parsing detects that it is not a well-formed document.
In this case well-formed means that all the tags are properly closed. What is a good ruby parser to use in this case which is also fast.