Skip to content
Discussion options

You must be logged in to vote

I would use a normalizer that removes any formatting that you don't want to support inside the block element. To get started writing a normalizer, override editor.normalizeNode using the withOverrides plugin option. You can detect whether the node being normalized is inside the block element using !!getBlockAbove(editor, { match: { type: YOUR_ELEMENT_TYPE } }).

Then, it's just a matter of checking for and removing formatting. For marks, you can use isMarkActive and removeMark. (If you optimistically try to remove marks without checking whether they're active, that might trigger an infinite normalization loop.)

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@JesseLiii
Comment options

@12joan
Comment options

@JesseLiii
Comment options

Answer selected by JesseLiii
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants