Skip to content

Commit b00790a

Browse files
crisbetojosephperrott
authored andcommitted
build: anchors not working correctly in markdown (#15379)
Fixes anchor links being rewritten to `/guides` in the docs. Fixes #15377.
1 parent 4f64b52 commit b00790a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/markdown-to-html/docs-marked-renderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class DocsMarkdownRenderer extends Renderer {
3838
// We only want to fix up markdown links that are relative and do not refer to guides already.
3939
// Otherwise we always map the link to the "guide/" path.
4040
// TODO(devversion): remove this logic and just disallow relative paths.
41-
if (!href.startsWith('http') && !href.includes('guide/')) {
41+
if (!href.startsWith('http') && !href.startsWith('#') && !href.includes('guide/')) {
4242
return super.link(`guide/${basename(href, extname(href))}`, title, text);
4343
}
4444

0 commit comments

Comments
 (0)