Failed to test node.hasMarkup()

When i tried to test if a node has markup, i wrote `

const isLink = node.hasMarkup(nodes.text, null, [mySchema.marks.link]);

I did it in a case where i was sure the returned boolean should be true , but it’s not.

After debugging , i saw that in a certain sameSet() an array containing a Mark class element and another having a MarkType element were being compared.

All i have to pass to the hasMarkup() is the the array with the MarkType element , i don’t know how i can get the Mark to pass it instead.

`

I think what you want in this case is mySchema.marks.link.isInSet(node.marks) (to check if the node has any link mark on it).

1 Like