X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FHTML-Zoom.git;a=blobdiff_plain;f=lib%2FHTML%2FZoom%2FParser%2FBuiltIn.pm;h=1e879191a3d6288d0b49c8e59c0075344a91fa4b;hp=13ae4441d01032eefb255493c9d9f33df90f7c10;hb=4c6b44299edb3613877d7e99586026423e9f15b5;hpb=5c77ed10c499025086e5d416966da7ff82124ef7 diff --git a/lib/HTML/Zoom/Parser/BuiltIn.pm b/lib/HTML/Zoom/Parser/BuiltIn.pm index 13ae444..1e87919 100644 --- a/lib/HTML/Zoom/Parser/BuiltIn.pm +++ b/lib/HTML/Zoom/Parser/BuiltIn.pm @@ -27,6 +27,10 @@ sub html_to_stream { sub _hacky_tag_parser { my ($text, $handler) = @_; + $text =~ m{^([^<]*)}g; + if ( length $1 ) { # leading PCDATA + $handler->({ type => 'TEXT', raw => $1 }); + } while ( $text =~ m{ (