Skip to content

Commit df7d33e

Browse files
rubysrvagg
authored andcommitted
tools: fix header escaping regression
quick fix for #22065 Preferred long term fix can be found at: #22140 PR-URL: #22084 Fixes: #22065 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 3804836 commit df7d33e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tools/doc/generate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ fs.readFile(filename, 'utf8', (er, input) => {
6767

6868
const content = unified()
6969
.use(markdown)
70+
.use(html.preprocessText)
7071
.use(json.jsonAPI, { filename })
7172
.use(html.firstHeader)
72-
.use(html.preprocessText)
7373
.use(html.preprocessElements, { filename })
7474
.use(html.buildToc, { filename })
7575
.use(remark2rehype, { allowDangerousHTML: true })

tools/doc/html.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,10 @@ function preprocessElements({ filename }) {
198198
heading.children = [{
199199
type: 'text',
200200
value: file.contents.slice(
201-
position.start.offset, position.end.offset),
201+
position.start.offset, position.end.offset)
202+
.replace('&lt;', '<')
203+
.replace('&gt;', '>')
204+
.replace(/\\(.{1})/g, '$1'),
202205
position
203206
}];
204207
}

0 commit comments

Comments
 (0)