Hey, I was following the information here [1] with the instructions by @saranrapjs to try to add block level marks to among other things paragraphs by using what is now setNodeMarkup
. Adding marks that way seems to work and rendering them to the dom also seems to work.
However, I have two issues with this approach:
-
I normally use
<span>
elements for marks. But I believe<span>
-elements are formally still meant to be used inline, whereas this gives me constructions such as<span><p>...</p></span>
. I solved this problem by adding aninline
-attribute to each of these marks and using<div>
-elements for marks if it’s false. But it feels a bit like this is information that should not need to be stored twice. -
Deleting text in paragraphs with marks creates odd editing operations. If I have a paragraph of a few words and hit backspace at the end of it, it reads it as if I was replacing the entire paragraph and replacing it with a new paragraph with almost the same contents. It then places the caret at the beginning of the first paragraph holding the mark.
My guess is that 2 happens because the dom-change-reading engine gets confused by the mark-tag around the paragraph and then doesn’t quite know what to do with it.
Has anyone found to put marks on block nodes without such results?