Leser: 2
4 Einträge, 1 Seite |
<img src=test.jpg />
<img src="test.jpg">
<img src="test.jpg" />
QuoteEmpty element tags look like start tags, but end with the character sequence "/>" instead of ">". When recognized by HTML::Parser they cause an artificial end event in addition to the start event. The text for the artificial end event will be empty and the tokenpos array will be undefined even though the the token array will have one element containing the tag name.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
#!/usr/local/bin/perl use strict; use warnings; use lib "lib"; use HTML::TagFilter; my $p = HTML::TagFilter->new ( strip_comments=>1, ); #eval { $p->strict_comment(1) }; #eval { $p->strict_names(1) }; #eval { $p->strict_end(1) }; #eval { $p->empty_element_tags(1) }; eval { $p->xml_mode(1) }; #eval { $p->marked_sections(1) }; $p->parse(<<'HTML'); <body onload="aaa"> <p onclick="a"><img onclick="AAAA" src="a" alt="99" /></p> <p /> <div> <br /> <hr /> <a href="a"/></div> <script/> </body> </html> HTML my $report = $p->report; print STDERR '-' x 30, "\n", "Report: \n", $report, "\n", '-' x 30, "\n\n" if defined $report; my $error_log = $p->error; print STDERR '-' x 30, "Errors: \n", "\n", $error_log, "\n", '-' x 30, "\n\n" if length $error_log; print $p->output;
4 Einträge, 1 Seite |