Out of curiosity, why do you say that the problem has not been solved?
Prior to your claim that "this problem is not solved in both end", I posted to both forums (here at PerlMonks and here at Stack Overflow) a suggestion to check out HTML::Valid.
According to the documentation of HTML::Tidy, you need to have tidyp installed first and tidyp appears to be a fork of tidy and that site indicates that it is the "HTML Tidy Legacy Website". The HTML::Valid module is based on the HTML Tidy project and it does support HTML5.
And I'll take it a bit further. Here's a demonstration of HTML::Valid on the OP's posted HTML/XHTML data.
I created a test.html file with the following content (from the OP):
And here's the Perl code that uses HTML::Valid to check that file:
And here's the output of that script:
That shows that HTML::Valid is not having issues dealing with <section> tags and that is also provides line numbers and column numbers as the OP stated here as something that was needed. Unfortunately it looks like HTML::Valid does not have an ignore method that was in the OP's code had that used HTML::Tidy, so the OP may need to write a little bit more code to parse out the messages concerning tags that the OP wants to ignore.
Unless I totally misunderstood what the "problem" was, it looks like HTML::Valid "solves" the "problem".
|