Skip to content

Add subtree opt-out for inline style mutations - #15970

Open
nperez0111 wants to merge 1 commit into
darkreader:mainfrom
nperez0111:exclude-blocknote-tiptap-from-dark-reader
Open

nperez0111 wants to merge 1 commit into
darkreader:mainfrom
nperez0111:exclude-blocknote-tiptap-from-dark-reader

Conversation

@nperez0111

Copy link
Copy Markdown

Hi, long-time darkreader user here.

I make a rich text editing library called BlockNote and our editor does not play well with having attributes being stamped on it's elements.

It looks like this has already been an issue before, ueberdosis/tiptap#3818 (comment) #14790 , since I see that there is a ProseMirror carve out (our base rich text editing framework). But, BlockNote uses elements that are deeper in the tree, so the carve-out for ProseMirror is not enough for our needs.

I thought the most reasonable way to go about this was to contribute something to darkreader, rather than having to add extension-specific detection to our editing library (like what was proposed here). Rich-text editors based on ProseMirror have this issue because ProseMirror heavily relies on the MutationObserver API to watch for changes to the rich text content, but darkreader stamping attributes everywhere both causes a lot of noise or in some cases can cause infinite loops like what is happening in BlockNote.

So, my suggestion here is to not just try to ignore anything that is ProseMirror/Tiptap/BlockNote based, and instead offer an attribute that marks this specific behavior as being disabled on this sub-tree so that we don't get elements being stamped causing infinite loops in our library.

@Myshor

Myshor commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

@alexanderby Core logic and dynamic theme performance impact (element.closest on inline mutations). Passing to you for review.

@Myshor
Myshor requested a review from alexanderby September 9, 2026 11:55
Support `data-darkreader-ignore-inline` to skip inline style and color
attribute writes on an element and its descendants. This lets editors
avoid mutation/re-render loops without library-specific exclusions.
@nperez0111
nperez0111 force-pushed the exclude-blocknote-tiptap-from-dark-reader branch from a6b48f7 to 290e2bf Compare October 28, 2026 21:42
@nperez0111

Copy link
Copy Markdown
Author

I've gone ahead and rebased this for review @alexanderby

@alexanderby

Copy link
Copy Markdown
Member

Hi @nperez0111, do you have any public URL where the issue could be reproduced?

We made some changes to prevent issues like that, currently available in Edge version only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants