Skip to content

Commit c73fab3

Browse files
committed
Hackily fix partial interface backlink generator
This fixes #187 by hard-coding knowledge of the post-syntax-highlighting markup into the script.
1 parent a4e353c commit c73fab3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.post-process-partial-backlink-generator.pl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
my %definitions;
77
my $inpre = 0;
88
while (<>) {
9-
$inpre = 1 if /<pre class=idl>/os;
10-
if ($inpre && /(partial )?interface <(span|dfn|a href=#[^ >]*) id=([^ >]*).*?>([^<:]*)?<\/(span|dfn|a)>(.*<!-- not obsolete -->)?/os) {
11-
my ($partial, $id, $name, $notobs) = ($1, $3, $4, $6);
12-
$notobs = $name eq 'NavigatorID'; # XXX hack for now
9+
$inpre = 1 if /<pre><code class='idl'>/os;
10+
if ($inpre && /(<c- b>partial<\/c-> )?<c- b>interface<\/c-> <(?:span|dfn|a href='#[^ >]*')(?: data-lt[^ ]*)? id='([^ >]*)'.*?><c- g>([^<:]*)?<\/c-><\/(span|dfn|a)>/os) {
11+
my ($partial, $id, $name) = ($1, $2, $3);
12+
my $notobs = 0; # XXX we can use this to avoid implying a partial interface is obsolete. Unused at the moment.
1313
$definitions{$name} = { } unless defined $definitions{$name};
1414
if ($partial) {
1515
$definitions{$name}{partial} = [] unless exists $definitions{$name}{partial};
@@ -19,18 +19,18 @@
1919
$definitions{$name}{primary} = $id;
2020
}
2121
}
22-
$inpre = 0 if /<\/pre>/os;
22+
$inpre = 0 if /<\/code><\/pre>/os;
2323
push(@lines, $_);
2424
}
2525

2626
die if $inpre;
2727

2828
my $current = '';
2929
foreach (@lines) {
30-
$inpre = 1 if /<pre class=idl>/os;
30+
$inpre = 1 if /<pre><code class='idl'>/os;
3131
if ($inpre) {
32-
if (/(partial )?interface <(span|dfn|a href=#[^ >]*) id=([^ >]*).*?>([^<:]*)?<\/(span|dfn|a)>/os) {
33-
my ($partial, $id, $name) = ($1, $3, $4);
32+
if (/(<c- b>partial<\/c-> )?<c- b>interface<\/c-> <(?:span|dfn|a href='#[^ >]*')(?: data-lt[^ ]*)? id='([^ >]*)'.*?><c- g>([^<:]*)?<\/c-><\/(span|dfn|a)>/os) {
33+
my ($partial, $id, $name) = ($1, $2, $3);
3434
die if $current;
3535
$current = $name unless $partial;
3636
}
@@ -47,6 +47,6 @@
4747
$current = '';
4848
}
4949
}
50-
$inpre = 0 if /<\/pre>/os;
50+
$inpre = 0 if /<\/code><\/pre>/os;
5151
print $_;
5252
}

0 commit comments

Comments
 (0)