Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Parser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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'");
}
Expand Down
8 changes: 4 additions & 4 deletions hparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/HTML/HeadParser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ sub flush_text # internal
# <!ENTITY % head.content "TITLE & BASE?">
# <!ELEMENT HEAD O O (%head.content;) +(%head.misc;)>
#
# 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
{
Expand Down Expand Up @@ -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') {
Expand Down