Closed tripodsan closed 4 years ago
just realized that the escaping is correct. sorry for the noise.
:+1:
Escaping can be better, but escaping markdown is rather complex, so I don’t easily see how this one would work. The escaping here does not cause any harm, as the escapes in destinations work too.
There was a similar issue recently but I couldn’t find it.
so I don’t easily see how this one would work.
right.... I think in the previous remark-parser, it didn't escape the _
in link urls.
That is correct. But the previous compiler had bugs, and this one has less bugs ;)
@wooorm there is also escaping of &
, which is also unexpected. what is the exact reason to escape anything within the (
)
of the link url? (except maybe a )
) ?
maybe treating the link URL as phrasing
is wrong :-)
Character references and -escapes work in link destinations, it’s intended behavior
Character references and -escapes work in link destinations, it’s intended behavior
so you mean that this md:
[foo][https://example.com/test".html]
would create a link url with https://example.com/test".html
when parsed?
yes.
We’re serializing markdown here, so if someone had actually escaped that:
[foo](https://example.com/test".html)
[foo](https://example.com/test\".html)
...we need to make sure it roundtrips.
Subject of the issue
Having a link with an url that contains a
_
will escape it.Steps to reproduce
For example, the following tree:
will produce this markdown:
Other examples:
Test markdown in github:
Expected behavior
The
_
in the URL should not be escaped.Actual behavior
The
_
in the URL is escaped.