-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[Task] Update RichText usage to avoid inline elements #8785
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
[Task] Update RichText usage to avoid inline elements #8785
Conversation
core-blocks/pullquote/index.js
Outdated
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.
- This class name is not adequately unique so as to avoid conflicts. Our CSS Naming Guidelines don't necessarily apply to blocks, but there are some general conventions here e.g.
wp-block-pullquote__citation - In JSX, you can assign a string prop value via the simpler
className="wp-block-pullquote__citation"syntax
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.
Sorry, should've been more careful. Addressed in this commit. Thank you @aduth ❤️
core-blocks/pullquote/theme.scss
Outdated
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.
These styles are enqueued on the front-end, but we'll never have .citation on the front-end display of this block. Conversely, there won't ever be a cite in the editor to match.
I think we may want this in editor.scss instead? I'm not entirely sure what our practice here is with theme.scss and editor-specific styles (cc @jasmussen ).
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.
Here's where I got confused as well. Putting editor specific styles in editor.scss makes more sense to me. But I noticed no styles from theme.scss were being rendered in the frontend, but only in the back-end.
I haven't changed the location of the CSS yet but can do if you prefer. But would love to hear about the practice with theme.scss and editor-specific styles as well. Thank you ❤️
|
I think merging in master went poorly here. You might have more luck with Feel free to ping me on Slack if you need assistance. |
…d of inline cite elements
|
Not sure what was going on with |
aduth
left a comment
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.
Apologies for the delay in revisiting this for review. It works great! Thanks for the patience and the work here 👍
Description
This PR closes #8773 which reports the incompatibility of inline
RichTextelements and TinyMCE.How has this been tested?
This PR has been tested by going through the following steps:
cite) are replaced with block-level elements (div).This was tested in WP 4.9.8, Gutenberg 3.4.0, Apache server with PHP 7.2.0 and MySQL 5.6.34. According to initial tests, the code doesn’t seem to affect any other areas.
Screenshots
Types of changes
This PR omits the
tagNameproperties in the citations for the quote and pull-quote blocks so that they convert to usingdivtags instead ofcite. It also updates styling to make sure the blocks look unchanged.Checklist: