Changeset 1867

Show
Ignore:
Timestamp:
11/27/06 12:20:19
Author:
miyagawa
Message:

Plagger::Text: Parse <a href=>foo</a> as HTML, rather than text

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/feature-geo/plagger/lib/Plagger/Text.pm

    r1741 r1867  
    2020    utf8::decode($text) unless utf8::is_utf8($text); 
    2121 
    22     my @tags = $text =~ m!<(\w+)\s?/?>!g; 
     22    my @tags = $text =~ m!<(\w+)(?:\s*\w+=["'][^"']*["'])?\s*/?>!g; 
    2323    my @unknown = grep !$HTML::Tagset::isKnown{$_}, @tags; 
     24 
    2425    my $type; 
    2526    if (@unknown > @tags / 2) { 
  • branches/feature-geo/plagger/t/core/text.t

    r1741 r1867  
    8888html: <p>Foo Bar <foo /></p> 
    8989 
    90  
     90=== A tags with attributes 
     91--- input 
     92<a href="http://maps.google.co.jp/?q=+35.123456,+135.123456">Foo</a> 
     93--- expected 
     94type: html 
     95plaintext: Foo 
     96html: <a href="http://maps.google.co.jp/?q=+35.123456,+135.123456">Foo</a>