DOMSerializer
A DOM serializer knows how to convert ProseMirror nodes and marks of various types to DOM nodes.
§Constructors
Create a serializer. nodes
should map node names to functions
that take a node and return a description of the corresponding
DOM. marks
does the same for mark names, but also gets an
argument that tells it whether the mark's content is block or
inline content (for typical use, it'll always be inline). A mark
serializer may be null
to indicate that marks of that type
should not be serialized.
§Properties
The mark serialization functions.
The node serialization functions.
§Methods
Serialize the content of this fragment to a DOM fragment. When
not in the browser, the document
option, containing a DOM
document, should be passed so that the serializer can create
nodes.
Serialize this node to a DOM node. This can be useful when you
need to serialize a part of a document, as opposed to the whole
document. To serialize a whole document, use
serializeFragment
on
its content.
§Static Methods
Build a serializer using the toDOM
properties in a schema's node and mark specs.
Gather the serializers in a schema's mark specs into an object.
Gather the serializers in a schema's node specs into an object. This can be useful as a base to build a custom serializer from.
Render an output spec to a DOM node. If
the spec has a hole (zero) in it, contentDOM
will point at the
node with the hole.