-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Autolink incorrectly dropping tildes #423
Comments
I think strikethrough parsing is interfering with autolinking |
Can you give me a full repro? Autolink and strikethrough both enabled, I don't have any trouble with the example given: $ comrak --version
comrak 0.24.1
$ cat colon-tilde.md
Here's an autolink: https://www.unicode.org/review/pri453/feedback.html#:~:text=Fri%20Jun%2024%2009:56:01%20CDT%202022.
$ comrak -e autolink -e strikethrough colon-tilde.md
<p>Here's an autolink: <a href="https://www.unicode.org/review/pri453/feedback.html#:~:text=Fri%20Jun%2024%2009:56:01%20CDT%202022">https://www.unicode.org/review/pri453/feedback.html#:~:text=Fri%20Jun%2024%2009:56:01%20CDT%202022</a>.</p> |
Ah I think you need two such URLs in the same line Here's an autolink: https://www.unicode.org/review/pri453/feedback.html#:~:text=Fri%20Jun%2024%2009:56:01%20CDT%202022 and another one https://www.unicode.org/review/pri453/feedback.html#:~:text=Fri%20Jun%2024%2009:56:01%20CDT%202022. with |
Thanks! Confirmed. This will take some careful comparison of the behaviour of Comrak and cmark-gfm (where strikethrough is done via the extensions API). I wonder if its autolink is managing to trigger first and therefore skip strikethrough entirely — Comrak does autolink in a postprocessing step, which is why there are so many issues (#58 #382 #388) with it. |
#426 addresses this! The solution was indeed to rework Comrak's autolinker to match cmark-gfm's in its structure (largely inline processed, with some postprocessing after). |
GitHub recognizes colons and tildes in URLs which is used by the "link to text section" (
#:~:text
) url fragment specifierhttps://www.unicode.org/review/pri453/feedback.html#:~:text=Fri%20Jun%2024%2009:56:01%20CDT%202022
I think the fix is just removing
~
and:
fromLINK_END_ASSORTMENT
?The text was updated successfully, but these errors were encountered: