-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[Task] Update RichText usage to avoid inline elements #8785
Conversation
core-blocks/pullquote/index.js
Outdated
@@ -86,6 +85,7 @@ export const settings = { | |||
citation: nextCitation, | |||
} ) | |||
} | |||
className={ `citation` } |
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
@@ -4,9 +4,11 @@ | |||
color: $dark-gray-600; | |||
|
|||
cite, | |||
footer { | |||
footer, | |||
.citation { |
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 |
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
RichText
elements 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
tagName
properties in the citations for the quote and pull-quote blocks so that they convert to usingdiv
tags instead ofcite
. It also updates styling to make sure the blocks look unchanged.Checklist: