Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

petdance (2468)

AOL IM: petdance (Add Buddy, Send Message)
Yahoo! ID: petdance (Add User, Send Message)

I'm Andy Lester, and I like to test stuff. I also write for the Perl Journal, and do tech edits on books. Sometimes I write code, too.

Journal of petdance (2468)

Thursday August 22, 2002
12:23 AM

String-breaking tags

[ #7234 ]
TorgoX has handed down this little hack for a problem I was having: It's a hash of the HTML tags that are implicitly whitespace.

# Uses HTML::Tagset

%Breaker_elements = map {; $_ => 1 } keys %HTML::Tagset::isKnown;
delete @Breaker_elements{ keys %HTML::Tagset::isPhraseMarkup };
$Breaker_elements{'br'} = 1;
$Breaker_elements{'hr'} = 1;
$Breaker_elements{'title'} = 1; # a hack

Now I can parse nicely!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.