From b00790a881e27f856811af211cfcad120fc8ce61 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Mon, 4 Mar 2019 20:17:31 +0100 Subject: [PATCH] build: anchors not working correctly in markdown (#15379) Fixes anchor links being rewritten to `/guides` in the docs. Fixes #15377. --- tools/markdown-to-html/docs-marked-renderer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/markdown-to-html/docs-marked-renderer.ts b/tools/markdown-to-html/docs-marked-renderer.ts index 21362086859..a0b773dac8c 100644 --- a/tools/markdown-to-html/docs-marked-renderer.ts +++ b/tools/markdown-to-html/docs-marked-renderer.ts @@ -38,7 +38,7 @@ export class DocsMarkdownRenderer extends Renderer { // We only want to fix up markdown links that are relative and do not refer to guides already. // Otherwise we always map the link to the "guide/" path. // TODO(devversion): remove this logic and just disallow relative paths. - if (!href.startsWith('http') && !href.includes('guide/')) { + if (!href.startsWith('http') && !href.startsWith('#') && !href.includes('guide/')) { return super.link(`guide/${basename(href, extname(href))}`, title, text); }