Closed robfig closed 1 year ago
That’s how they work in GH: Just a URL: www.example.com/help_me .
Welcome @robfig! 👋 Sorry you ran into a spot of trouble.
The current behavior matches GitHub Flavored markdown
You can confirm this by taking your example
Just a URL: www.example.com/help\\_me .
pasting it into GitHub
Just a URL: www.example.com/help\_me .
and inspecting the result
<a href="http://www.example.com/help%5C%5C_me" rel="nofollow">www.example.com/help\\_me</a>
micromark-extension-gfm-autolink
matches the autolinking behavior to GitHub.
I maintain a rich-text editor that stores content in Markdown. Literal underscores are escaped so that they are not interpreted. Markdown is the storage format, but the user is not typing markdown and they should not have to escape markdown special characters. The result is that underscores within a URL are escaped.
My humble suggestion is have the editor generate valid GFM. Rather than creating yet another bespoke flavor of markdown.
Markdown is the storage format, but the user is not typing markdown and they should not have to escape markdown special characters.
So is HTML. And users needs to know how to handle things like <
too
Hi! This was closed. Team: If this was fixed, please add phase/solved
. Otherwise, please add one of the no/*
labels.
Initial checklist
Affected packages and versions
Latest
Link to runnable example
No response
Steps to reproduce
I maintain a rich-text editor that stores content in Markdown. Literal underscores are escaped so that they are not interpreted. Markdown is the storage format, but the user is not typing markdown and they should not have to escape markdown special characters. The result is that underscores within a URL are escaped.
I believe there are two options:
The second option seems pretty difficult to me. I don't see other options.
The first option seems reasonable even for use cases other than my own -- the autolinker is used at display-time, yet it places restrictions on the way users author their markdown. That dependency seems undesirable.
Expected behavior
Actual behavior
Runtime
No response
Package manager
No response
OS
No response
Build and bundle tools
No response