fix: emit autolink content verbatim without escapes#77
Conversation
This comment has been minimized.
This comment has been minimized.
|
The CI failure looks unrelated to this change: |
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
This reverts commit dceb99b.
|
Hi! Did you see the code around it? e.g.: Can you explain what you ran into? |
|
Hi! Thanks for taking the time to contribute! This has been marked by a maintainer as needing more info. It’s not clear yet whether this is an issue. Here are a couple tips:
Thanks, |
|
Yes, the stack clearing handles the unsafe patterns, since those are filtered through patternInScope. What it doesn't cover is escapeBackslashes() at the bottom of lib/util/safe.js, which runs unconditionally and doubles a backslash that sits before ASCII punctuation (here the closing > passed as config.after). So on main, fromMarkdown('aa:\\') gives a link whose text is 'aa:\', and toMarkdown emits 'aa:\\\\'; that round-trip is what the added test covers. |
Initial checklist
Description of changes
Autolink content is interpreted literally per CommonMark, so the serializer no longer routes it through phrasing escaping, which was doubling backslashes (and escaping other characters) in the URL on round-trip. Closes #73.