Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

fix: correct links in doc-viewer markdown files to have the proper base value #554

Merged
merged 1 commit into from
Nov 27, 2018

Conversation

josephperrott
Copy link
Member

@josephperrott josephperrott commented Oct 30, 2018

private updateDocument(rawDocument: string) {
// Replaces all hash base links with the current path
const correctedDocument = rawDocument.replace(
/(<a href="#)+/g, `<a href="${window.location.pathname}#`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you run this through DomSanitizer.sanitize?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn
Copy link
Member

jelbourn commented Nov 1, 2018

@josephperrott looks like the tst fails now

@josephperrott josephperrott merged commit 704a5d0 into angular:master Nov 27, 2018
@josephperrott josephperrott deleted the correct-md-links branch November 27, 2018 16:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants