X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDOM%2FTiny%2F_HTML.pm;h=04a5344715031c5f4b50768333c466fceaff1ec7;hb=b1ec524b3b6c75361f548d73cfda0282db607a9d;hp=41c5cedc774df7524fbc9f40dcbd25e2baa98365;hpb=2d9f516571abb22d42ea26ffaf07bda8a29314f0;p=catagits%2FDOM-Tiny.git diff --git a/lib/DOM/Tiny/_HTML.pm b/lib/DOM/Tiny/_HTML.pm index 41c5ced..04a5344 100644 --- a/lib/DOM/Tiny/_HTML.pm +++ b/lib/DOM/Tiny/_HTML.pm @@ -5,7 +5,7 @@ use warnings; use DOM::Tiny::Entities qw(html_escape html_unescape); use Scalar::Util 'weaken'; -our $VERSION = '0.002'; +our $VERSION = '0.004'; my $ATTR_RE = qr/ ([^<>=\s\/]+|\/) # Key @@ -47,14 +47,13 @@ my %RAW = map { $_ => 1 } qw(script style); # HTML elements that only contain raw text and entities my %RCDATA = map { $_ => 1 } qw(title textarea); -my %END = ( - # HTML elements with optional end tags - body => 'head', optgroup => 'optgroup', option => 'option', - # HTML elements that break paragraphs - map +($_ => 'p'), - qw(address article aside blockquote dir div dl fieldset footer form h1 h2), - qw(h3 h4 h5 h6 header hr main menu nav ol p pre section table ul) -); +# HTML elements with optional end tags +my %END = (body => 'head', optgroup => 'optgroup', option => 'option'); + +# HTML elements that break paragraphs +$END{$_} = 'p' for + qw(address article aside blockquote dir div dl fieldset footer form h1 h2), + qw(h3 h4 h5 h6 header hr main menu nav ol p pre section table ul); # HTML table elements with optional end tags my %TABLE = map { $_ => 1 } qw(colgroup tbody td tfoot th thead tr);