From cb57660981bee42fda8abc730e7f763ae357c598 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Wed, 1 Mar 2017 18:17:49 +0100 Subject: [PATCH] fix(docs): only rewrite relative links (#3339) Fixes #3147 --- tools/gulp/tasks/docs.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/gulp/tasks/docs.ts b/tools/gulp/tasks/docs.ts index 14fcdbbeb13e..551ebcff984f 100644 --- a/tools/gulp/tasks/docs.ts +++ b/tools/gulp/tasks/docs.ts @@ -82,7 +82,9 @@ function transformMarkdownFiles(buffer: Buffer, file: any): string { /** Fixes paths in the markdown files to work in the material-docs-io. */ function fixMarkdownDocLinks(link: string, filePath: string): string { - if (link.startsWith('http') && filePath.indexOf('guides/') === -1) { + // As for now, only markdown links that are relative and inside of the guides/ directory + // will be rewritten. + if (!filePath.includes(path.normalize('guides/')) || link.startsWith('http')) { return link; }