gh-markdown-cli
gh-markdown-cli copied to clipboard
mailto: links break the generated HTML
I am trying to do this:
$ echo "[Send email](mailto:[email protected])" | mdown
I am expecting this output:
<p><a href="mailto:[email protected]">Send email</a></p>
But instead I get this:
<p><a href="mailto:<a href='mailto:[email protected]'>[email protected]</a>">Send email</a></p>
I guess this might be a problem with the underlying parser? Or maybe this syntax isn't supported?
It's an issue on the markdown parser.
If you do echo "[email protected]" | mdown it generates the "mailto" link <p><a href="mailto:[email protected]">[email protected]</a></p>.
Maybe we should change the parser, see #4.
Yes, I can see the offending line: https://github.com/isaacs/github-flavored-markdown/blob/master/scripts/showdown.js#L193
Perhaps it would be easier to submit a patch to the markdown parser project to only add the anchor tag if the mailto is not already present, much in the same way that regular URL links are parsed: https://github.com/isaacs/github-flavored-markdown/blob/master/scripts/showdown.js#L188
@fiznool based on the README on isaacs repository (that github abandoned the JS implementation) I guess we should change the markdown parser to one that follows GFM closer. I will leave this bug opened to remind we should replace the parser.
Just stumbled over this again :wink: