Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b98bf82

Browse filesBrowse files
rubystargos
authored andcommitted
tools: build API TOC using raw headers
Markdown interprets the syntax for optional arguments as a form of a link, so instead of trying to build up the contents using the node value, use grab the raw original markup instead. Fixes regression noted in #21490 (comment) PR-URL: #21922 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent eabe907 commit b98bf82
Copy full SHA for b98bf82

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Open diff view settings
Collapse file

‎tools/doc/html.js‎

Copy file name to clipboardExpand all lines: tools/doc/html.js
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,10 @@ function buildToc({ filename }) {
340340

341341
depth = node.depth;
342342
const realFilename = path.basename(realFilenames[0], '.md');
343-
const headingText = node.children.map((child) => child.value)
344-
.join().trim();
343+
const headingText = node.children.map((child) =>
344+
file.contents.slice(child.position.start.offset,
345+
child.position.end.offset)
346+
).join('').trim();
345347
const id = getId(`${realFilename}_${headingText}`, idCounters);
346348

347349
const hasStability = node.stability !== undefined;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.