Question1: Let’s say that some marks are not allowed for paragraph nodes. For example, paragraph nodes should accept only inline marks as their content.
const mySchema = new Schema({
nodes: {
text: {
group: "inline"
},
paragraph: {
group: "block",
content: "inline*",
marks: 'inline',
toDOM() { return ["p", 0] },
parseDOM: [{tag: "p"}]
},
doc: {content: "block+"}
},
marks: {
strong: {
group: 'inline',
toDOM() { return ["strong", 0] }
},
}
})
But when a text node is added, there is no check to test if registered marks are allowed, see
I think node creation process should respect the node/marks specs. Is there a chance this will be changed? Thanks!
Question2:
Currently, block level marks are allowed: Discussion: What are marks - #15 by marijn.
But when a block node is added the registered marks are not saved for the current parsed node, see:
prosemirror-markdown/from_markdown.js at master · ProseMirror/prosemirror-markdown · GitHub
Why registered marks are reset before adding the current block node? By doing so, the block level marks will be ignored. Is there a chance this will be changed? Thanks!