mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
build: anchors not working correctly in markdown (#15379)
Fixes anchor links being rewritten to `/guides` in the docs. Fixes #15377.
This commit is contained in:
committed by
Joey Perrott
parent
4f64b52fd7
commit
b00790a881
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user