You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's common to want to check whether an element (inline/block) matches a specific set of properties. The naive way is to just check element.type === type, but that doesn't account for things like headings where you might have a data.level === 2 to check as well.
What's the expected behavior?
We should add a method that makes this easy to check. It should take Object|String, and use Block.createProperties to normalize them. And then check to see if the element has the properties in question.
I think we should also add a getProperties that returns just the settable properties of the element (ie. type and data), omitting the other things that are present when fully serializing.
The text was updated successfully, but these errors were encountered:
Do you want to request a feature or report a bug?
Feature.
What's the current behavior?
It's common to want to check whether an element (inline/block) matches a specific set of properties. The naive way is to just check
element.type === type
, but that doesn't account for things like headings where you might have adata.level === 2
to check as well.What's the expected behavior?
We should add a method that makes this easy to check. It should take
Object|String
, and useBlock.createProperties
to normalize them. And then check to see if the element has the properties in question.I think we should also add a
getProperties
that returns just the settable properties of the element (ie.type
anddata
), omitting the other things that are present when fully serializing.The text was updated successfully, but these errors were encountered: