fix(docs): only rewrite relative links (#3339)

Fixes #3147
This commit is contained in:
Paul Gschwendtner
2017-03-01 18:17:49 +01:00
committed by Kara
parent 7d53acd3ef
commit cb57660981
+3 -1
View File
@@ -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;
}