You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When highlighting a word and applying a markdown format to the word, the word stays visually highlighted. Repeated use of the markdown format however merely removes the highlight without removing the format. Otherwise, toggling markdown formatting works as expected.
The text was updated successfully, but these errors were encountered:
I just created the ticket myself since I have a solution ready.
Turns out the issue is that when you toggle from a selection, the selection is restored "backwards" afterwards. That is, when you make a selection, the UI puts the cursor at the end of it. But the code that makes sure the selection is still present after the formatting tags are added actually applied the selection backwards so that the cursor is at the beginning.
Now, what causes the deselection is a special case that makes sure you don't add more markdown tags after existing tags, so that it doesn't produce **text in bold****|** where | is the cursor. Since the cursor was left at the beginning of the selection, the leading ** triggered this when you tried to toggle the bold format off, which cancelled the operation instead of toggling it.
This code is very convoluted because there are a lot of different behaviours depending on a bunch of conditions. 😄
From #1804 by @HeyMyian
The text was updated successfully, but these errors were encountered: