What is the "universal: true" statement in the following code for?
isAziendaMarkActive(editor) { const [match] = Editor.nodes(editor, { match: n => n.isAzienda === true, universal: true, }) Thanks so much, Elena
1 Answer
Setting universal: true returns the matching nodes if and only if all of the selected nodes match your query.
So, in your case, isAziendaMarkActive() would return false for the following selection:
<AziendaMark> A </AziendaMark> B <AziendaMark> C </AziendaMark> but true for this:
<AziendaMark> A B C </AziendaMark>