-
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
Provide a minimum of code wrapping for the code block. #26623
Conversation
Size Change: +42 B (0%) Total Size: 1.21 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 think this seems fine to include. As noted over here, the latest two default themes provide code to wrap this on the front end by default.
The most important thing is just making sure that the front-end matches the back end here. This helps with that.
Thank you Kjell! Now if only I could get the checks to pass :) |
81cdb0d
to
a88bbb8
Compare
a88bbb8
to
f7f4226
Compare
Is this a bug fix? Does it happen on Core too? Should we backport it to WP 5.6 ? |
Yes, I think it's worth backporting. It fixes an unintended change to how the code block displays in the editor (and syncs up the front-end styles too, which turned out to be a longstanding issue). |
* Provide a minimum of code wrapping for the code block. (#26623) * Block Support: Fix font size style when applying block support (#26762) * Fix Separator editor styles (#27071) * Fix the Post author selector for contributors (#26554) Co-authored-by: Riad Benguella <benguella@gmail.com> * Align single half width column to left (#27142) * remove the auto margin for individual column blocks * update margin values for blocks in blocks to zero insted of auto * Add backward compatibility support for lightBlockWrapper in getSaveElement (#27189) * Code block: paste plain text (#27236) * paste plain text option * Add e2e test * Fix crash when null date passed to TimePicker (#27316) * Fix crash when null date passed. * Update test * Fix GH actions "cancel" step (#27025) * use new syntax for setting env var * Update package-lock * Update package-lock again * Remove the button only option from the UI until it can be wired up to something that works in the front end. (#27379) * Fix combobox csuggestion list closure when clicking scrollbar (#27367) Co-authored-by: Joen A <1204802+jasmussen@users.noreply.github.com> Co-authored-by: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Co-authored-by: Nik Tsekouras <ntsekouras@outlook.com> Co-authored-by: Adam Silverstein <adamsilverstein@earthboundhosting.com> Co-authored-by: Riad Benguella <benguella@gmail.com> Co-authored-by: andrei draganescu <me@andreidraganescu.info> Co-authored-by: Daniel Richards <daniel.richards@automattic.com> Co-authored-by: Ella van Durpe <wp@iseulde.com> Co-authored-by: Noah Allen <noahtallen@gmail.com> Co-authored-by: Andy Peatling <apeatling@users.noreply.github.com>
Fixes #26600.
I'm not entirely sure what might have caused this, but #26600 suggests that a recent change casued text in the code block to stop wrapping. I'm not sure what that might be, the only recent change is #26347 and that doesn't look like it would've caused anything.
But in any case, this PR explicitly allows code to break words and wrap:
Right now it does that in the
style.scss
file which loads for every code block. That's a big opinionated change to the block, so it needs a bit sanity check.On the flipside, if we move those rules to
theme.scss
, very few themes will actually benefit from this change. But I'm happy to do so if that's desired. Let me know your thoughts!