Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Support mapping links to full URLs from hint Github repo #934

Merged
merged 2 commits into from
Aug 20, 2020

Conversation

sarvaje
Copy link
Contributor

@sarvaje sarvaje commented Aug 13, 2020

Fix #933

Pull request checklist

Make sure you:

Short description of the change(s)

@sarvaje sarvaje requested review from antross, johnemau and molant August 13, 2020 23:01
* In this case we need to replace it with the a valid
* url in the website.
*/
if (val[2].startsWith('https')) {
Copy link
Member

Choose a reason for hiding this comment

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

It is a bit weird to say the link is for github and then check just for https.

Suggested change
if (val[2].startsWith('https')) {
if (val[2].startsWith('https://github.com/')) {

if (val[2].startsWith('https')) {
replacement =
`${val[1]}/docs/${file.frontMatter.section}${file.frontMatter.tocTitle ? `/${file.frontMatter.tocTitle.replace(' ', '-')}` : ''}/${val[4].replace('/docs/', '/')}/`;

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we could document what the different val[x] are?

@sarvaje
Copy link
Contributor Author

sarvaje commented Aug 14, 2020

@molant I have addressed all your feedback.

I also fix an edge case, when the package is the hint one.

@sarvaje sarvaje requested a review from molant August 14, 2020 22:56
Copy link

@johnemau johnemau left a comment

Choose a reason for hiding this comment

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

LGMT

@antross
Copy link
Member

antross commented Aug 19, 2020

@molant any additional feedback or is this good to merge?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support mapping links to full URLs from hint GitHub repo
4 participants