Skip to content

Commit 004e014

Browse files
committed
Fix up document.write/writeln cases
1 parent 94ade7e commit 004e014

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

wattsi2bikeshed.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,17 @@ function convert(infile, outfile) {
219219
}
220220
}
221221

222+
// Remove leading "document." from linking text of document.write/writeln.
223+
if (dfn.hasAttribute('method') && dfn.getAttribute('for') === 'Document' &&
224+
!dfn.hasAttribute('data-lt')) {
225+
for (const lt of lts) {
226+
if (lt.startsWith('document.')) {
227+
dfn.setAttribute('data-lt', lt.substring(9));
228+
break;
229+
}
230+
}
231+
}
232+
222233
// Put data-x values into local-lt to enable disambiguating <dfn>s
223234
// with the same linking text, but only if it's not already in lts.
224235
if (source === kCrossRefAttribute && !lts.has(topic)) {

0 commit comments

Comments
 (0)