gravity-ui / markdown-editor

Markdown wysiwyg and markup editor
https://preview.gravity-ui.com/md-editor/
MIT License
180 stars 12 forks source link

If you insert a link with "?" at the end of the link in the text, the text will be replaced by a link #471

Open nikita-jpg opened 2 weeks ago

nikita-jpg commented 2 weeks ago

Steps to Reproduce

  1. Create a link with "?" "http://example.com/?"
  2. Highlight the text ("test text")
  3. Paste URL using Ctrl + V.

Expected Behavior

The display text should be updated to the new URL .

Actual Behavior

It was: "test text". Become: "http://example.com?"

makhnatkin commented 2 weeks ago

We use linkify for parsing from the buffer, it in turn works like this, you can check it in the demo. I assume that from the point of view of markdown behavior, this can be considered valid, because there may be a question mark at the end of the line and it refers to the line, not to the link.

On the other hand, when inserting from the buffer, we may need to solve this differently, for example use some regexp

@nikita-jpg maybe you have some ideas?