-
-
Notifications
You must be signed in to change notification settings - Fork 314
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
Parsing of underscores in URLs #670
Comments
CommonMark doesn't support just a url. GFM does. So, this sounds more like a problem with GFM? It's not a lot of info to go on to debug your problem... |
When I paste the link on https://spec.commonmark.org/dingus/ 'oftc' is rendered italic. It's also italic when I'm sent the link in Element and breaks the URL into two pieces. I can copy the link from the rendered view, but the it is wrong because the two underscores are not in the pasted URL anymore. |
No, GFM keeps the link intact by not rendering 'oftc' italic in an URL when between two underscores. |
CommonMark does not support “autolinks” directly, but GFM and other implementations include an extension that parses raw URLs into links. In vanilla CM you world have to enclose an URL with angular brackets to have it recognized. No markup inside of the address will be applied then:
|
Or, if you don't want it to be a hyperlink, use code backticks
|
I know that I can use either backticks or angular brackets, but the user that sends me the link might not, breaking the link for me. Does that mean that Element.io implements the ComomMark specs wrongly, because the URL that is sent to me is autolinked (and broken up in the process)? |
It means that Element.io implements a superset of CommonMark and the problem lies weiterhin their extension (which happens to be a common one). |
Today I learned that Element.io uses Commonmark.
And I was shared a link to a room, namely https://app.element.io/#/room/#_oftc_#osm-ch:matrix.org
Commonmark parses this as
and breaks the URL into two pieces.
These two pieces can be copy-pasted to a browser, but then don't link to the correct place anymore.
I think that underscores in URLs should not be parsed, like GFM does not and keep the URL intact.
The text was updated successfully, but these errors were encountered: