ProseMirror: How to add classes and data to text?

412 Views Asked by At

Trying to use the incredibly professional looking ProseMirror WYSIWYM editor to tag words in a text field with IDs, and give tagged words a background-color. E.g.

The horses took off

...might result in the html:

The <span class="tagged" data-id="horse">horses</span> <span class="tagged" data-id="take_off_2">took off</span>

The learning curve is steep for ProseMirror, I'm finding it difficult to find my feet. Anyone have any tips on what PM libraries and functions might be used to add/remove data and classes to words? Not even sure if spans are the way to do it.

0

There are 0 best solutions below