-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
gfm mode underscore in link url starts emphasis #4079
Comments
@0b10011 Do you want to take a look? |
Yeah, I should be able to get to this in the next 24-48 hours. |
Sorry about the delay! I've looked into this and added a PR that fixes the issue. Had to adjust the overlay.js code to make it possible for gfm to communicate effectively with markdown (to freeze markdown's state while parsing links). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproducible here: http://codemirror.net/mode/gfm/index.html
While using the gfm mode if there is an underscore in the url get parameters this triggers the start of an emphasis block. So if you have an inline link with an underscore the text following is emphasised.
Here is a link, https://test.com?_test and this text is in italics
I would expect the underscore within the link to be ignored for formatting.
I took a look at the code but seems like it may be a non-trivial fix as the underscore logic is in the markdown mode where as this "autolink" logic is in the gfm mode. Is it as simple as setting state.linkHref in the gfm link logic? https://github.com/codemirror/CodeMirror/blob/master/mode/gfm/gfm.js#L106
Is the state shared between modes? Sorry this is the first time at looking at how CodeMirror works so I don't have a clear understanding yet.
The text was updated successfully, but these errors were encountered: