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

Doesn't highlight URLs with certain hash fragments correctly #1142

Closed
prtksxna opened this issue Jun 2, 2017 · 2 comments
Closed

Doesn't highlight URLs with certain hash fragments correctly #1142

prtksxna opened this issue Jun 2, 2017 · 2 comments

Comments

@prtksxna
Copy link

prtksxna commented Jun 2, 2017

If the following code is higlighted:

// See documentation at: 
// https://doc.wikimedia.org/oojs-ui/master/js/#!/api/OO.ui.ButtonWidget
new OO.ui.ButtonWidget( {
	"label": "Normal"
} )

The URL in the second line is only highlighted (and turned into a link) till the # that is - https://doc.wikimedia.org/oojs-ui/master/js/# which takes the user to the wrong place.

Workaround

prism-autolinker supports Markdown syntax, so we can work around it like this:

url = 'https://doc.wikimedia.org/oojs-ui/master/js/#!/api/OO.ui.ButtonWidget';
out = '// See documentation at: \n// [' + url + '](' + url + ')\n' + out;

Details

This was discovered while creating the following patch - https://gerrit.wikimedia.org/r/#/c/356398

@Golmote
Copy link
Contributor

Golmote commented Mar 4, 2018

Thanks for reporting! It should be fixed now.

@prtksxna
Copy link
Author

prtksxna commented Mar 5, 2018

Thanks @Golmote :)

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

No branches or pull requests

2 participants