Can't undo bold by applying bold again

(Erlend Sogge Heggen) #1

If I mark something and press ctrl-b it’ll be bolded. If I press ctrl-b again right away, it’ll be unbolded. However, if I write some text, mark it, press ctrl-b and then continue writing, I can not come back to this text, mark it, and press ctrl-b to undo the bold. Instead it’ll just add additional asterisks.

(Erlend Sogge Heggen) #2

Should I report this issue directly to your Markdown engine instead?

(Kasper Peulen) #3

For me this does work. Strange. Do you mark the whole thing, or only the thing inside the asterisks ?

(Sam Saffron) #4

No repro here, closing in 48 hours unless someone can come up with a repro.

(Jens Maier) #5

I’m guessing it’s about this behaviour:

  1. Ctrl+B**strong text**
  2. Select text, Ctrl+B**strong **text****

(Erlend Sogge Heggen) #6

Exactly. Same problem if you highlight all of **strong text**

(Jens Maier) #7

Actually, if you select strong text without the enclosing asterisks, it works as intended.

Basically, the formatter never checks whether the selected text is considered bold to decide whether to add asterisks, remove them or do something else. It only checks the characters immediately before and after the selection; if those are **, it removes them; if they’re anything else, it adds asterisks.

Still, since the editor isn’t WYSIWYG, I wouldn’t call this a bug but a feature request. :confused:

(Sam Saffron) #8

I can accept this as a feature request, but even as a feature req, implementing it may end up breaking other cases.

(Erlend Sogge Heggen) #9

It’s really no biggie. You could have archived this without me ever noticing :grinning: don’t spend any more time on it for my sake.

(Sam Saffron) #10

I like cleaning up the bug category, and now that I can easily hunt bugs down it makes it easier.