tools: fix header escaping regression
quick fix for #22065 Preferred long term fix can be found at: https://github.com/nodejs/node/pull/22140 PR-URL: https://github.com/nodejs/node/pull/22084 Fixes: https://github.com/nodejs/node/issues/22065 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
parent
f8fda89df1
commit
59f8276a6b
@ -67,9 +67,9 @@ fs.readFile(filename, 'utf8', (er, input) => {
|
||||
|
||||
const content = unified()
|
||||
.use(markdown)
|
||||
.use(html.preprocessText)
|
||||
.use(json.jsonAPI, { filename })
|
||||
.use(html.firstHeader)
|
||||
.use(html.preprocessText)
|
||||
.use(html.preprocessElements, { filename })
|
||||
.use(html.buildToc, { filename })
|
||||
.use(remark2rehype, { allowDangerousHTML: true })
|
||||
|
@ -198,7 +198,10 @@ function preprocessElements({ filename }) {
|
||||
heading.children = [{
|
||||
type: 'text',
|
||||
value: file.contents.slice(
|
||||
position.start.offset, position.end.offset),
|
||||
position.start.offset, position.end.offset)
|
||||
.replace('<', '<')
|
||||
.replace('>', '>')
|
||||
.replace(/\\(.{1})/g, '$1'),
|
||||
position
|
||||
}];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user