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> 

See:

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.