ProseMirror / prosemirror-markdown

ProseMirror Markdown integration
https://prosemirror.net
MIT License
344 stars 81 forks source link

Fix escaping of parentheses in links and images #79

Closed susnux closed 2 years ago

susnux commented 2 years ago

If the URL contains a ) character the link is currently not correctly serialized.

marijnh commented 2 years ago

Could you resubmit this without the spurious whitespace changes in the test file? (Turn off whole-file auto-reindentation in your editor.)

susnux commented 2 years ago

@marijnh Fixed that.

I think it happened because everywhere else the lines are indented by 2 spaces, except those three lines where 3 spaces are used.

marijnh commented 2 years ago

Markdown handles balanced parentheses in URLs automatically. I.e. [foo](bar(baz)) is a valid link. Escaping one of the parens will break that ([foo](bar(baz\)) is not a valid link). So this should probably escape opening parens as well.

susnux commented 2 years ago

So this should probably escape opening parens as well.

You are right! Fixed that, too.

marijnh commented 2 years ago

Thanks!