SWE-rebench leaderboard — July 2026 task
harbor run -t ibragim-badertdinov/ueberdosis__tiptap-7887harbor download ibragim-badertdinov/ueberdosis__tiptap-7887[PRO]: unsetAllMarks deletes comments
extension-comments
2.17.5
Our Tiptap editor has a "clear formatting" button that calls unsetAllMarks to remove formatting from the selection.
We noticed, however, that if the selection includes content associated with a comment, the comment is also deleted (presumably because the <span> element wrapping the content is removed).
Is this a bug? I can see how we might want unsetAllMarks to include comments, if we consider the comment tag a "mark," but at the same time I imagine users would generally not expect unsetAllMarks to delete comments.
For now, as a workaround, we are calling unsetMark separately for all non-comment marks, e.g.
editor.chain().focus().unsetMark('link').unsetMark('bold').unsetMark('strike') ...
... but would be nice to be able to use unsetAllMarks again for formatting-specific marks. Thanks!
Chrome
No response
unsetAllMarks will remove formatting marks (listed here) but not remove comment tags or comments.
No response
Marks are clearable by default. A mark configured with clearable: false must survive unsetAllMarks(), while unsetAllMarks({ignoreClearable: true}) removes it. Calling can().unsetAllMarks() on a selection containing only non-clearable marks is a successful no-op and must return true; explicitly calling unsetMark may still remove a non-clearable mark.
Type: Mark configuration option Name: MarkConfig.clearable Path: packages/core/src/Mark.ts Type: boolean | (() => boolean) Default: true Description: Controls whether unsetAllMarks removes this mark. Set false for semantic marks such as comments that must survive clear-formatting operations.
Type: Command Name: unsetAllMarks Path: packages/core/src/commands/unsetAllMarks.ts Input: options?: { ignoreClearable?: boolean } Output: ReturnType Description: Removes clearable marks from the current selection. Marks configured with clearable: false are preserved unless ignoreClearable is true. can().unsetAllMarks() returns true when the selection contains only non-clearable marks; this case is a successful no-op.