joemccann / dillinger

The last Markdown editor, ever.
https://dillinger.io
MIT License
7.9k stars 1.1k forks source link

Using unicode format codepoint Word Joiner is buggy #857

Open clavelm opened 8 months ago

clavelm commented 8 months ago

Context

I’m using markdown on the fediverse where support of it depends of the client. Let’s say I’m sharing[message](https://url.c/) I’m adding unicode word joiner WJ to invisibly separate markdown syntax from it’s content so the closing parenthesis is not added at the end of the URL breaking it. Same thing to separate the text of the message from the squared brackets. Maybe there is a better way to do it (advise me).

Testing it on dillinger

Not being sure if it would break the markdown, I tried it here, but dillinger has a problem with it.

So I paste [⁠message⁠](⁠https://url.c/⁠) (4 WJ are added, you can get them by copying the code). Here as seen in notepad++: notepad++

This is how it renders (I added a newline for better selection later): 2023 10 10 104657 - firefox

But, there are 4 invisible entities here (only the first 3 selected in that screenshot): 2023 10 10 104823 - firefox

If the cursor is just after the fourth entity, something happens near the first t of https: 2023 10 10 105021 - firefox

Trying to delete or replace that last entity do the action on the ending parenthesis. 2023 10 10 105536 - firefox

Replacing the third entity with something visible inserts it between the / and the ) and the invisible entity disappears.

The displayed text is not matching the selection/edition.