diff --git a/Parser.pm b/Parser.pm index 9c2fc21..14ebb53 100644 --- a/Parser.pm +++ b/Parser.pm @@ -66,7 +66,7 @@ sub init if ($option =~ /^(\w+)_h$/) { $self->handler($1 => @$val); } - elsif ($option =~ /^(text|start|end|process|declaration|comment)$/) { + elsif ($option =~ /^(?:text|start|end|process|declaration|comment)$/) { require Carp; Carp::croak("Bad constructor option '$option'"); } diff --git a/hparser.c b/hparser.c index 3b2461e..0570a0c 100644 --- a/hparser.c +++ b/hparser.c @@ -1271,15 +1271,15 @@ parse_start(PSTATE* p_state, char *beg, char *end, U32 utf8, SV* self) int empty_tag = 0; dTOKENS(16); - hctype_t tag_name_first, tag_name_char; + hctype_t tag_name_char; hctype_t attr_name_first, attr_name_char; if (STRICT_NAMES(p_state)) { - tag_name_first = attr_name_first = HCTYPE_NAME_FIRST; - tag_name_char = attr_name_char = HCTYPE_NAME_CHAR; + attr_name_first = HCTYPE_NAME_FIRST; + tag_name_char = attr_name_char = HCTYPE_NAME_CHAR; } else { - tag_name_first = tag_name_char = HCTYPE_NOT_SPACE_GT; + tag_name_char = HCTYPE_NOT_SPACE_GT; attr_name_first = HCTYPE_NOT_SPACE_GT; attr_name_char = HCTYPE_NOT_SPACE_EQ_GT; } diff --git a/lib/HTML/HeadParser.pm b/lib/HTML/HeadParser.pm index 28e9cac..6115fdb 100644 --- a/lib/HTML/HeadParser.pm +++ b/lib/HTML/HeadParser.pm @@ -185,10 +185,10 @@ sub flush_text # internal # # # -# From HTML 5 as of WD-html5-20090825: +# From HTML Living Standard as of 24 May 2017: # # One or more elements of metadata content, [...] -# => base, command, link, meta, noscript, script, style, title +# => base, link, meta, noscript, script, style, template, title sub start { @@ -218,7 +218,7 @@ sub start # This is a non-standard header. Perhaps we should just ignore # this element $self->{'header'}->push_header(Isindex => $attr->{prompt} || '?'); - } elsif ($tag =~ /^(?:title|noscript|object|command)$/) { + } elsif ($tag =~ /^(?:title|noscript|object|template)$/) { # Just remember tag. Initialize header when we see the end tag. $self->{'tag'} = $tag; } elsif ($tag eq 'link') {