Skip to content

fix(site): Improve loaders parsing of external link in headers #2470

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

Closed
wants to merge 2 commits into from
Closed

fix(site): Improve loaders parsing of external link in headers #2470

wants to merge 2 commits into from

Conversation

budmc29
Copy link
Contributor

@budmc29 budmc29 commented Aug 26, 2018

Improve the way external links (like licences) in headers are parsed and generated on the website.

Before:
image

After (the link will act as expected and point the user to the document etc):
image

This issue is encountered in multiple loaders pages (and possibly in other pages as well), but here's one example:
https://webpack.js.org/loaders/worker-loader/

@EugeneHlushko
Copy link
Member

I think this is already changed in rebuild branch, right @montogeek ?

@montogeek montogeek added the UI/UX label Sep 2, 2018
@montogeek
Copy link
Member

It is broken as well, but in a different way:
image

@montogeek
Copy link
Member

@budmc29 We are in an effort to modernize this repo infrastructure, our work is in the rebuild branch, Could you please fix the issue on that branch? Thanks

@budmc29
Copy link
Contributor Author

budmc29 commented Sep 3, 2018

Yes, I can have a look at that, should we close this?

@budmc29
Copy link
Contributor Author

budmc29 commented Sep 3, 2018

@montogeek I did a fresh yarn fetch && yarn start on the rebuild branch, and it looks like the issue is fixed.

image

http://localhost:3000/loaders/worker-loader

Or is the attached screenshot from a different loader?

@montogeek
Copy link
Member

It was the same loader, let me try again

@montogeek
Copy link
Member

It was fixed by: #2453, I didn't have latest rebuild changes when taking the screenshot.

Although I am not sure if it is good to link the RAW file, it should link to the rendered markdown:
https://github.com/webpack-contrib/worker-loader/blob/master/.github/CONTRIBUTING.md
instead of
https://raw.githubusercontent.com/webpack-contrib/worker-loader/master/.github/CONTRIBUTING.md

What do you think @Munter ?

@Munter
Copy link
Collaborator

Munter commented Sep 4, 2018

@montogeek It does sound like a nicer experience to go the the Github UI for the markdown files. The problem is that the url we get in options.source is on raw.githubusercontent.com, and all relative links are resolved from the source URL. I don't know if there is a safe way to make that URL transformation. There's quite a few edge cases I had to cover to fix all the errors I found. And those links are mostly part of the external hyperlink check, so you'd have to manually inspect the output of that run to ensure everything still works

@montogeek
Copy link
Member

@Munter I can take a look, or do you want to do it @budmc29 ?

@budmc29
Copy link
Contributor Author

budmc29 commented Sep 4, 2018

@montogeek I'd like to give it a try and see how it goes, and open another PR.

We can close this for now since it's not relevant anymore.

Thanks

@montogeek montogeek closed this Sep 4, 2018
@budmc29 budmc29 deleted the fix_links_in_header_parsing branch September 27, 2018 22:14
montogeek pushed a commit that referenced this pull request Sep 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants