Thank you, I've added this one to the Gist too! (and in the meantime I added a XML::LibXML solution for the XHTML as well)
Since HTML::TokeParser and HTML::Parser even live in the same distribution, I'll look at a pull request to change the parser type to the one that works.
It looks to me like HTML::TokeParser isa HTML::Parser, so I think it's probably possible to set the options required to parse the XHTML (marked_sections and xml_mode) - but it looks like WWW::Mechanize doesn't provide any way to set custom options on the parser.
In reply to Re^2: Why a regex *really* isn't good enough for HTML, even for "simple" tasks
by haukex
in thread Why a regex *really* isn't good enough for HTML and XML, even for "simple" tasks
by haukex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |