I want to make a block level annotation
Have search some topic. A little fuzzed about is it support " block level mark" or not
I want to make a block level annotation
Have search some topic. A little fuzzed about is it support " block level mark" or not
By default, nodes with block children don’t allow marks on their children, but you can use NodeSpec.marks
to override that.
Thank you marijn .
I make a mermaid node wrap with a mark .
:::comment
\`\`\`mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
\`\`\`
:::
it render well at first, but when i append a paragragh node after this node(use tr) , get a error Uncaught TransformError: Invalid content for node doc
But I make a paragragh node after this node at first . nothing happend . very wired
this is the code to " append a paragragh node"
view: () => ({
update: (view: EditorView) => {
const { state } = view;
const { schema, doc, tr } = state;
const shouldInsertNodeAtEnd = trailingPluginKey.getState(state);
const node = schema.nodes['paragraph']?.create();
if (!shouldInsertNodeAtEnd || !node) {
return;
}
const transaction = tr.insert(doc.content.size, node).setMeta('appendingParagraph', true);
view.dispatch(transaction);
},
}),
The doc need to add marks