Skip to content

Commit 97daf29

Browse files
sideshowbarkerdomenic
authored andcommitted
Make .pre-process-tag-omission.pl handle linebreak
This change makes the .pre-process-tag-omission.pl script work as expected in the case where a heading for an element section breaks across multiple lines. Otherwise, without this change, the script fails for a case like this: <h4 element data-lt="meta" id="the-meta-element">The <dfn id="meta"><code>meta</code></dfn> element</h4> ...that is, a case where the "element</h4>" part isn’t on the same line as the "<code>meta</code></dfn>" part.
1 parent 947d955 commit 97daf29

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

.pre-process-tag-omission.pl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ sub pushLine {
2727
$mode = 'optionals';
2828
} elsif ($_ eq " <dt><dfn>Void elements</dfn></dt>\n") {
2929
$mode = 'voids';
30-
} elsif ($_ =~ m!<code>([^<]+)</code></dfn> elements?</h4>!) {
30+
} elsif ($_ =~ m!<code>([^<]+)</code></dfn> elements?</h4>!
31+
|| $_ =~ m!id="the-[^-]+-element"[^>]*>The <dfn[^>]*><code>([^<]+)</code>!) {
3132
$current = $1;
3233
$mode = 'element';
3334
}
@@ -37,8 +38,6 @@ sub pushLine {
3738
push(@lines, \$line);
3839
$insertionPoints{$current} = \$line;
3940
$mode = 'bored';
40-
} elsif ($_ =~ m!</h!) {
41-
die 'confused';
4241
} else {
4342
# ignore...
4443
}

0 commit comments

Comments
 (0)