You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the current moment ExtensionBuilder has two methods to declare new nodes and marks:
// for nodesbuilder.addNode();// for marksbuilder.addMark();
In each method you should provide:
prosemirror schema spec
markdown parser spec
markdown serializer spec
custom view for entity (optional)
This is inconvenient for several reasons:
impossible to separate declaration for prosemirror from declaration for markdown parsing and serializing
sometimes it is required to parse different markdown-tokens into one prosemirror-node (for example, parse code_block and fence tokens to code_block-node in prosemirror). In this case you should add empty schema spec and empty serializer spec into builder.addNode()
Proposal
Split builder.addNode() and builder.addMark() into separate methods:
At the current moment
ExtensionBuilder
has two methods to declare new nodes and marks:In each method you should provide:
This is inconvenient for several reasons:
code_block
andfence
tokens tocode_block
-node in prosemirror). In this case you should add empty schema spec and empty serializer spec intobuilder.addNode()
Proposal
Split
builder.addNode()
andbuilder.addMark()
into separate methods:And refactor code in
CodeBlockSpecs
extensionThe text was updated successfully, but these errors were encountered: