bevacqua / woofmark

:dog2: Barking up the DOM tree. A modular, progressive, and beautiful Markdown and HTML editor

Home Page:https://bevacqua.github.io/woofmark

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Toolbar button state and toggling modes.

iliaznk opened this issue · comments

Great work, first of all! But got a couple of questions.

  1. Is it possible to have buttons reflect current state of a selection/cursor position? For example, if a bold text is selected or the cursor is within a bold text, then we can style the bold button as active.
  2. Is it possible to have formatting buttons toggle their state? For example, when in WSIWYG mode you click the bold button (or press the cmd+B shortcut) you get bold text, but you can't toggle it off by pressing the button or the shortcut for the second time.

Maybe I was wrong or maybe you've done some corrections already, but now I see that toggling is working, but when you press the button (or shortcut) for the second time you still get a placeholder like 'bold text' for example, which may be a bit confusing for an end user.

Feel free to implement something like this but I won't be doing it any time soon. Closing for now