Changeset 1560
- Timestamp:
- 08/21/06 18:44:04
- Files:
-
- branches/hackathon-summary/plagger/lib/Plagger/Text.pm (modified) (1 diff)
- branches/hackathon-summary/plagger/t/core/text.t (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/hackathon-summary/plagger/lib/Plagger/Text.pm
r1549 r1560 21 21 22 22 my @tags = $text =~ m!<(\w+)\s?/?>!g; 23 my @unknown = grep !$HTML::Tagset::isKnown{$_}, @tags; 23 24 my $type; 24 if ( grep !$HTML::Tagset::isKnown{$_}, @tags) {25 if (@unknown > @tags / 2) { 25 26 $type = 'text'; 26 27 } elsif (@tags || $text =~ m!&(?:amp|gt|lt|quot);!) { branches/hackathon-summary/plagger/t/core/text.t
r1549 r1560 80 80 html: "<foo>Hello</foo>" 81 81 82 === Unknown Tags ... but lots of known tags 83 --- input 84 <p>Foo Bar <foo /></p> 85 --- expected 86 type: html 87 plaintext: Foo Bar 88 html: <p>Foo Bar <foo /></p> 82 89 90
