-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "Rich text: pad multiple spaces through en/em replacement" #58792
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -57 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that I couldn't move the caret between two spaces to insert a link. Happy to give an approving ✅ instead of having to figure it out myself! 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In WordPress 6.4 before #56341 was applied, when multiple spaces are inserted in a paragraph block, the following behavior occurs:
- Multiple spaces are visually preserved in the editor
- In the front end, multiple spaces become a single space
In this PR, which reverts #56341, when multiple spaces are inserted in a paragraph block, the following behavior occurs:
- In the editor, multiple spaces become a single space when you save a post and reload the browser. However, multiple spaces remain on the code editor
- In the front end, multiple spaces become a single space
Is this the expected behavior with this PR? The screencast below shows what happens when I insert multiple spaces with this PR.
471c78078af381e041a045bc949d642e.mp4
Yes, that's how it worked before, and that's how HTML works: multiple normal spaces collapse to a single space. Som editors pad with non breaking spaces, but this leads to buggy behaviour and non breaking spaces getting littered all over. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, then there's no problem 👍
I would like to add a backport label because this issue fixes a bug introduced in WP6.5. |
)" This reverts commit 53cae01.
9c07f5c
to
958273e
Compare
Flaky tests detected in 958273e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7870426460
|
* trunk: (273 commits) Remove preffered style variations legacy support (#58930) Style theme variations: add property extraction and merge utils (#58803) Migrate `change-detection` to Playwright (#58767) Update Changelog for 17.6.6 Docs: Clarify the status of the wp-block-styles theme support, and its intent (#58915) Use `data_wp_context` helper in core blocks and remove `data-wp-interactive` object (#58943) Try double enter for details block. (#58903) Template revisions API: move from experimental to compat/6.4 (#58920) Editor: Remove inline toolbar preference (#58945) Clean up link control CSS. (#58934) Font Library: Show error message when no fonts found to install (#58914) Block Bindings: lock editing of blocks by default (#58787) Editor: Remove the 'all' rendering mode (#58935) Pagination Numbers: Add `data-wp-key` to pagination numbers if enhanced pagination is enabled (#58189) Close link preview if collapsed selection when creating link (#58896) Fix incorrect useAnchor positioning when switching from virtual to rich text elements (#58900) Upgrade Floating UI packages, fix nested iframe positioning bug (#58932) Site editor: fix start patterns store selector (#58813) Revert "Rich text: pad multiple spaces through en/em replacement (#56341)" (#58792) Documentation: Clarify the performance reference commit and how to pick it (#58927) ...
)" (#58792) This reverts commit 53cae01. Co-authored-by: ellatrix <[email protected]> Co-authored-by: jeryj <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: dmsnell <[email protected]>
I just cherry-picked this PR to the backports/beta1 branch to get it included in the next release: 1adfe8d |
)" (#58792) This reverts commit 53cae01. Co-authored-by: ellatrix <[email protected]> Co-authored-by: jeryj <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: dmsnell <[email protected]>
)" (#58792) This reverts commit 53cae01. Co-authored-by: ellatrix <[email protected]> Co-authored-by: jeryj <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: dmsnell <[email protected]>
Hi! I submitted #56855 and #58605 (more to come... (*))
Assuming you speak of within param (
[Parameter(Position=0, Mandatory=$False)]
[string] $action = "discovery"
)
That's no excuse. WordPress is used by a lot of coders / developers, who display code of some sort on their website / blog. That no one complained doesn't mean no one noted the difference in how code is displayed within pre tags. (*) Just noticed that when I copy one code block in Gutenberg to another location or post, it copies |
This should not apply to code tags or pre tags. As the screencast below shows, multiple spaces are maintained in both the front end and the editor. 5e2c51f7a62f67cb734fa0a590499e49.mp4
My understanding is that this is an intentional change to unify line break codes that differ depending on the OS. |
Note that as part of curating the Gutenberg 17.8 changelog, I added the label [Feature] Rich Text to this PR to better categorize it. Please let me know if there is a different label that would be a better fit. |
Reverts #56341
Partly fixes #58659.
Alternatively we need to only do this when whitespace is not preserved. But that becomes a bit messy imo.
The downside of reverting this is that you cannot see multiple spaces on the front-end, but 🤷♀️ it's not that anyone has complained so far!