Skip to content
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

Fix font-size handling and line wrapping in latest Gutenberg #230

Merged
merged 5 commits into from
Dec 3, 2020

Conversation

westonruter
Copy link
Owner

Fixes #228
Fixes #229

  • Changing the font-size in Gutenberg 9.5 will now ensure that any highlighted lines will maintain their position.
  • When in Gutenberg 9.2+, the lines of text are now added to the overlay without escaping since a RichText component is used instead of PlainText. Line wrapping (or no-wrapping) is also now applies as expected. This was missed in a previous PR.

👎 Before, upon changing the font size to small or large:

image
image

👍 After:

image
image

Comment on lines +282 to +283
// Copy the styles to ensure that the code-block-overlay is updated when the font size is changed in Gutenberg 9.5+.
textAreaProps.style = blockProps.style;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I was missing!! I was exploring to see how Gutenberg had changed but didn't think to copy over the styles. I love it 👍

@westonruter westonruter merged commit 82fbdf8 into develop Dec 3, 2020
@westonruter westonruter deleted the fix/font-size branch December 3, 2020 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants