remarkjs / remark-gfm

remark plugin to support GFM (autolink literals, footnotes, strikethrough, tables, tasklists)
https://remark.js.org
MIT License
713 stars 24 forks source link

Markdown [https://www.twilio.com/](https://www.twilio.com/) links are not rendered as expected #7

Closed sunknudsen closed 3 years ago

sunknudsen commented 3 years ago

Subject of the issue

Let's say we have the following markdown.

Go to [https://www.twilio.com/](https://www.twilio.com/) and sign up.

[https://www.twilio.com/](https://www.twilio.com/) is rendered as [https://www.twilio.com/](https://www.twilio.com/) vs a https://www.twilio.com/ hyperlink with a https://www.twilio.com/ href.

Screen Shot 2021-01-31 at 6 37 35 PM

Your environment

Steps to reproduce

This should be pretty straightforward to reproduce using above markdown.

Expected behavior

[https://www.twilio.com/](https://www.twilio.com/) should be rendered as https://www.twilio.com/ hyperlink with a https://www.twilio.com/ href.

Actual behavior

[https://www.twilio.com/](https://www.twilio.com/) is rendered as [https://www.twilio.com/](https://www.twilio.com/).

ChristianMurphy commented 3 years ago

The issue is related to autolink literals, this issue is being tracked at https://github.com/micromark/micromark-extension-gfm-autolink-literal/issues/5 and a possible solution in the works at https://github.com/micromark/micromark-extension-gfm-autolink-literal/pull/6 closing this issue, as it isn't actionable at the remark-gfm level and will be resolved in micromark-extension-gfm-autolink-literal

ChristianMurphy commented 3 years ago

There's also a potential work around described here: https://github.com/remarkjs/remark-gfm/issues/6#issuecomment-767775803

sunknudsen commented 3 years ago

Thanks for the heads-up @ChristianMurphy. Thankfully, I "own" the content and used \[(http.*?)\]\(\1\) to find and replace links to $1.