Skip to content

Commit 255654d

Browse files
committed
doc: fix header escaping regression
fixes nodejs#22065
1 parent 7cec27c commit 255654d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-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

+2-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ 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(/\\./g, (match) => match[1]),
202203
position
203204
}];
204205
}

0 commit comments

Comments
 (0)