I’d like to limit a paragraph to have at most one image (in our schema this is an ‘embed’). Can this be done? I don’t understand how to write the paragraph valid content expression that does it.
I’ve tried variations such as:
inline* embed? inline*
(while removing embed from the inline group)
This gives me an error that says Possibly ambiguous overlapping adjacent content expressions
This is the schema right now:
nodes: {
doc: {type: Doc, content: 'block+'},
paragraph: {type: Paragraph, content: 'inline<_>*', group: 'block'},
blockquote: {type: BlockQuote, content: 'block+', group: 'block'},
ordered_list: {type: OrderedList, content: 'list_item+', group: 'block'},
bullet_list: {type: BulletList, content: 'list_item+', group: 'block'},
horizontal_rule: {type: HorizontalRule, group: 'block'},
page_break: {type: PageBreak, group: 'block'},
heading: {type: Heading, content: 'inline<_>*', group: 'block'},
code_block: {type: CodeBlock, content: 'text*', group: 'block'},
list_item: {type: ListItem, content: 'paragraph block*'},
text: {type: Text, group: 'inline'},
emoji: {type: Emoji, group: 'inline'},
embed: {type: Embed, group: 'inline'},
},