Repository navigation
Add subtree opt-out for inline style mutations - #15970
Open
nperez0111 wants to merge 1 commit into
Open
nperez0111 wants to merge 1 commit into
nperez0111 wants to merge 1 commit into
Conversation
Collaborator
|
@alexanderby Core logic and dynamic theme performance impact (element.closest on inline mutations). Passing to you for review. |
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
force-pushed
the
exclude-blocknote-tiptap-from-dark-reader
branch
from
October 28, 2026 21:42
a6b48f7 to
290e2bf
Compare
Author
|
I've gone ahead and rebased this for review @alexanderby |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.