Hello! Maybe a strange use case, but I am considering adding DOM comment nodes to my documents. My idea is to parse comment nodes as-is and to render them as normal DOM nodes in the editor, then later serializing them as comment nodes again.
The issue is that I don’t know how to accomplish this using the schema: I can use a TagParseRule, but there’s no CSS selector to target comment nodes, so the tag
property doesn’t work. This means that some DOM node types (Comment
, and less importantly CDATASection
and ProcessingInstruction
) seem unparseable with the standard parser.
If this is out of scope for ProseMirror, could I get a pointer on how to implement this? A custom DOMParser with a new type of rule, maybe?
In any case, thanks a lot for ProseMirror, I appreciate your work!