commonmark/cmark

How to support a link with space?

Closed this issue · 4 comments

For example,

[Title](Link To The Resource)

The parsing is failed due to the space, is that possible to somehow make it work?

jgm commented

URI-encode the spaces as %20.

URI-encode the spaces as %20.

Thank you @jgm. Yes encoding should be working, however parsing with space can improve the readability I think.
Or where is the best place that I shall begin with if I want to change the code for this?

jgm commented

The code is fine, it conforms to the spec:

https://spec.commonmark.org/0.30/#link-destination

As noted there, another option would be to include the whole thing in <..>, then you can use spaces (but not newlines).

<..>

Thanks, that's a great solution!