Skip to content

Commit

Permalink
fix(docs): only rewrite relative links (#3339)
Browse files Browse the repository at this point in the history
Fixes #3147
  • Loading branch information
devversion authored and kara committed Mar 1, 2017
1 parent 7d53acd commit cb57660
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/gulp/tasks/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit cb57660

Please sign in to comment.