Skip to content

Commit

Permalink
processing instructions are a little less common
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 16, 2014
1 parent 08e35af commit 34c1438
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

5.15 2014-07-15
5.15 2014-07-16
- Improved Mojo::DOM::HTML performance slightly.

5.14 2014-07-14
Expand Down
6 changes: 3 additions & 3 deletions lib/Mojo/DOM/HTML.pm
Expand Up @@ -25,8 +25,6 @@ my $TOKEN_RE = qr/
([^<]+)? # Text
(?:
<(?:
\?(.*?)\? # Processing Instruction
|
!(?:
--(.*?)--\s* # Comment
|
Expand All @@ -38,6 +36,8 @@ my $TOKEN_RE = qr/
(?:\s+\[.+?\])? # Int Subset
\s*)
)
|
\?(.*?)\? # Processing Instruction
|
(\s*[^<>\s]+ # Tag
\s*(?:(?:$ATTR_RE){0,32766})*+) # Attributes
Expand Down Expand Up @@ -106,7 +106,7 @@ sub parse {
my $xml = $self->xml;
my $current = my $tree = ['root'];
while ($html =~ m/\G$TOKEN_RE/gcso) {
my ($text, $pi, $comment, $cdata, $doctype, $tag, $runaway)
my ($text, $comment, $cdata, $doctype, $pi, $tag, $runaway)
= ($1, $2, $3, $4, $5, $6, $11);

# Text (and runaway "<")
Expand Down

0 comments on commit 34c1438

Please sign in to comment.