Marks without rendered DOM nodes


Is it possible to create marks that do not have a toDOM method? We want to store data attrs on ranges of text using marks so we can map them and use them in some of our decoration plugins.

Currently, we are returning a span element for each mark.

entity: {
      attrs: {
        sample: { default: 'sample' },
      toDOM: () => ['span'],

We have noticed: When documents become extremely large the marks begin to slow things down.

Is it possible to use marks without rendering anything in the DOM?


This isn’t currently possible (the display assumes each mark has a corresponding DOM node), but there’s no deep reason why it is that way, it’s just how the implementation currently works.