How to remove all marks of a type on the parent node? #1776
Answered
by
hanspagel
EasterPeanut
asked this question in
Questions & Help
-
I currently got: editor.chain().focus().selectParentNode().unsetCode().toggleHeading({ level: level }).run() but this will reset my cursor position/selection. Is there a way to remove code marks on the parent node while keeping the position/selection untouched? Or is there a better solution to disable inline code in my headings? |
Beta Was this translation helpful? Give feedback.
Answered by
hanspagel
Aug 22, 2021
Replies: 1 comment 1 reply
-
Yes! This is how the CodeBlock disallows marks: https://github.com/ueberdosis/tiptap/blob/main/packages/extension-code-block/src/code-block.ts#L37 Read more: |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
hanspagel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes! This is how the CodeBlock disallows marks:
https://github.com/ueberdosis/tiptap/blob/main/packages/extension-code-block/src/code-block.ts#L37
Read more:
https://www.tiptap.dev/api/schema/#marks