Skip to content

Commit

Permalink
tools: fix header escaping regression
Browse files Browse the repository at this point in the history
quick fix for #22065

Preferred long term fix can be found at:
#22140

PR-URL: #22084
Fixes: #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>
  • Loading branch information
rubys authored and rvagg committed Aug 15, 2018
1 parent a7dad45 commit 6cd2d1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/doc/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down
5 changes: 4 additions & 1 deletion tools/doc/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('&lt;', '<')
.replace('&gt;', '>')
.replace(/\\(.{1})/g, '$1'),
position
}];
}
Expand Down

0 comments on commit 6cd2d1d

Please sign in to comment.