Repository navigation
Conversation
Member
|
Restores whitespace for block splitting, but also restores it after the field is emptied. Subsequent structured paste can create unwanted blank paragraphs around the pasted blocks. |
meh7an
force-pushed
the
fix/rich-editor-enter-split-whitespace
branch
from
October 22, 2026 18:39
3c8e9ff to
09d276d
Compare
Contributor
Author
Thanks, fixed. The trimmed edge whitespace is now added to the insert context only while the field has text, the same way it's restored when the field is committed, so pasting blocks into an emptied paragraph doesn't leave blank paragraphs around them anymore. |
This branch has not been deployed
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.
The article editor shows a block's text in its field without the leading and trailing whitespace and puts that whitespace back when the field is committed.
activeTextInsertContext()built its before, selected and after parts from the field's text only, so for a block with such whitespace the parts didn't add up to the stored text. Enter in the middle of a paragraph, list item or quote splits the block only when the parts cover its whole text, so instead of splitting it the editor added an empty paragraph below. Other actions that rebuild the text from the same parts, like inserting blocks into it, lost the whitespace as well.The parts now include the trimmed whitespace, the same way
applyFieldTextToState()restores it, so they match the stored text.Testing
Tested on macOS 27.0, in a Debug build: