# This covers the majority of rules %bal_tag_attribs = ( # Tags with ok attributes a => [qw(href name target)], # I added this one, and there is a later as well colgroup => [ qw(align span valign width) ], font => ["color size"], ol => ["type"], # Balancing

looks strange but align needs closing p => ["align"], table => [ qw(bgcolor border cellpadding cellspacing width) ], td => [ qw(align bgcolor colspan height rowspan valign width) ], tr => [qw(align valign width)], # Ones without attributes # I omitted the 'nbsp' tag, should that be 'nobr'? map {$_, []} qw( b big blockquote br dd dl dt em h1 h2 h3 h4 h5 h6 hr i li pre small strike strong sub sup tt u ul ), ); # Initialize default handlers %handlers = ( # literal text with special meanings we allow ( map {my $tag = $_; ($tag, sub {return $tag})} qw(&
) ), # Various html tags &ret_tag_handlers(%bal_tag_attribs), # And our escape mode. '[code]' => ret_escape_code(qr(\[/code\]), "[code]"), );