Hi I want to make text-highlight plugin for ProseMirror. I added button to the menu which shows a popover with 20 color buttons and one more button to remove color. Now I want to write appropriate Commands for these buttons, i.e. after choosing a specific color, the selected text should get this color and when adding text within highlighted area, it should also get this color. Similarly for “remove” button I would like to remove color for the selection (move back to default black color). Currently I added a new mark
which returns span
with style = "color:red"
and I used toggleMark
as a command. Unfortunately, this solution obviously only adds red
color and toggling is not enough here because it removes the color when I clicked it again. I don’t know how I could setup the commands in order to make it works (using specific colors and removing color). I would appreciate any help with that.