HTML::Tree - doctype bug, documentation update, HTML::Element documentation bug
Terrence Brannon <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.lwp |
|---|---|
| Message-ID | <[email protected]> |
A few things about HTML::Tree - DOCTYPE bug =for comment This program shows that HTML::TreeBuilder renders a document with the DOCTYPE declaration in the wrong place. In the docs, Sean says that DOCTYPE decl is not important. It wasn't when he wrote TreeBuilder but it is becoming more important these days. =cut use strict; use warnings; use HTML::TreeBuilder; my $html =<<'EOHTML'; <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> blah blah </body> </html> EOHTML my $tree = HTML::TreeBuilder->new; $tree->store_declarations(1); $tree->parse($html); $tree->eof; print $tree->as_HTML(undef, " "); rework of HTML::Element docs to use head3 instead of item The table of contents for HTML::Element does not list the method names because they were documented using =item instead of =head3. I'd be happy to rewrite them this weekend. here's a small doc bug. http://search.cpan.org/~petdance/HTML-Tree-3.1901/lib/HTML/Element.pm <http://search.cpan.org/%7Epetdance/HTML-Tree-3.1901/lib/HTML/Element.pm> ~literal pseudo-elements These objects are not currently produced by HTML::TreeBuilder, but can be used to represent a "super-literal" -- i.e., a literal you want to be immune from escaping. (Yes, I just made that term up.) That is, this is useful if you want to insert code into a tree that you plan to dump out with as_HTML, where you want, for some reason, to suppress as_HTML's normal behavior of amp-quoting text segments. For expample, this: ^^^^^^ - mis-spelling