Add ContainerBlot Formatting Support and Optimize Insertion Behavior #4753
+386
−5
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.
This PR introduces enhanced formatting behavior for
ContainerBlotand improves how formatting is applied during blot insertion. These changes ensure better compatibility with nested container structures and allow formats to be propagated and applied more consistently across complex document trees.Look at the changes contained in the PR on parchment.
Key Improvements
ContainerBlotFormatting SupportEnables
ContainerBlotto accept and apply formatting.Ensures that formats defined on parent blots are properly inherited.
Implementation detail
Ensures format data is preserved and passed appropriately during blot creation.
Calls
formatAtonly after all insertion logic is completed.Prevents partial formatting application and resolves edge cases involving nested structures. For example when the containers are NOT ready yet and becomes ready through call to
optimizemethod.Adjusts Parchment logic to correctly interpret and apply
ContainerBlot-level formats. See the parchment PR detail mentioned above.Extends format resolution behavior so that container-level formatting is recognized alongside inline and block formats.
Related Issue
This addresses formatting consistency issues similar to those described in:
#4750
Why This Matters
These changes improve correctness and flexibility when working with complex container elements, making formatting behavior more predictable and bringing Quill closer to expected behavior in real-world rich-text editing scenarios.
Testing
Verified formatting propagation during nested container insertion.
Confirmed proper execution order of insertion → formatting.
Ensured backward compatibility with existing blots and custom formats.
Test cases related to this pr depends on the changes reflected on the PR on parchment.