Skip to content

Commit cb57660

Browse files
devversionkara
authored andcommitted
fix(docs): only rewrite relative links (#3339)
Fixes #3147
1 parent 7d53acd commit cb57660

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: tools/gulp/tasks/docs.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ function transformMarkdownFiles(buffer: Buffer, file: any): string {
8282

8383
/** Fixes paths in the markdown files to work in the material-docs-io. */
8484
function fixMarkdownDocLinks(link: string, filePath: string): string {
85-
if (link.startsWith('http') && filePath.indexOf('guides/') === -1) {
85+
// As for now, only markdown links that are relative and inside of the guides/ directory
86+
// will be rewritten.
87+
if (!filePath.includes(path.normalize('guides/')) || link.startsWith('http')) {
8688
return link;
8789
}
8890

0 commit comments

Comments
 (0)