WordPress.org

Make WordPress Core

Opened 6 months ago

Closed 6 months ago

Last modified 6 months ago

#49772 closed defect (bug) (fixed)

Support additional elements (table, ol, ul) in privacy policy guide new styling

Reported by: garrett-eclipse Owned by: garrett-eclipse
Milestone: 5.4.1 Priority: normal
Severity: normal Version: 5.4
Component: Privacy Keywords: has-patch has-screenshots commit
Focuses: ui, css, administration Cc:

Description (last modified by garrett-eclipse)

With 5.4 (r47147 / #44621) the privacy policy guide aesthetic was updated to introduce a white background on the suggested text. In the CSS this only applies to paragraph elements (<p>).

Reviewing some other plugin implementations there is at minimum a need to also support <ul>, <ol>, and <table> elements.
*I've only gone through the top 15 plugins from the link above so further investigation is in order.

This primarily comes from a comment on the woocommerce PR here;

"Tested in WP 5.0 and 5.3.2, and in both cases the difference is that <p> sections inside the "Source: WooCommerce" section appear in italics after applying the changes; other elements (mostly <li>) appear unchanged. Is this the expected behavior?"

While it refers to pre-5.4 the issue persists and gets worse in 5.4 in that it's not just italics but now padding and background which becomes jarring when it goes from a paragraph (styled) to a list (unstyled) and back to paragraph (styled).

The white background in 5.4 is meant to denote the content being copied and as such should encompass these other elements;
p - already does
h# - shouldn't as the design excludes them
hr - maybe
ul - yes, used in plugins (example)
ol - yes, used in plugins (example)
table - yes, used in plugins - (example)
div - potentially
... - Open to others as well.

Also note the list items aren't denoted with bullet points in the current design. This makes them look like paragraphs and could be confusing.

Attachments (6)

Screen Shot 2020-04-01 at 3.15.35 PM.png (109.1 KB) - added by garrett-eclipse 6 months ago.
This example from WooCommerce shows the heading, a suggested paragraph, a suggested list (no bg or bullets), another suggested paragraph and finally a tutorial note. The list is left out of place even though it will be part of the copied content.
49772.diff (1.7 KB) - added by garrett-eclipse 6 months ago.
Full working patch to address plugins with the new styling of privacy policy guide
Screen Shot 2020-04-06 at 4.13.19 PM.png (299.5 KB) - added by garrett-eclipse 6 months ago.
Unaffected WP suggested content
Screen Shot 2020-04-06 at 4.48.38 PM.png (93.6 KB) - added by garrett-eclipse 6 months ago.
Bullet list within suggested content
Screen Shot 2020-04-06 at 4.48.32 PM.png (290.4 KB) - added by garrett-eclipse 6 months ago.
numeric list inside of suggested text
Screen Shot 2020-04-06 at 4.48.54 PM.png (132.9 KB) - added by garrett-eclipse 6 months ago.
table inside of suggested text

Download all attachments as: .zip

Change History (15)

@garrett-eclipse
6 months ago

This example from WooCommerce shows the heading, a suggested paragraph, a suggested list (no bg or bullets), another suggested paragraph and finally a tutorial note. The list is left out of place even though it will be part of the copied content.

#1 @garrett-eclipse
6 months ago

  • Description modified (diff)

#2 @garrett-eclipse
6 months ago

  • Description modified (diff)

@garrett-eclipse
6 months ago

Full working patch to address plugins with the new styling of privacy policy guide

@garrett-eclipse
6 months ago

Unaffected WP suggested content

@garrett-eclipse
6 months ago

Bullet list within suggested content

@garrett-eclipse
6 months ago

numeric list inside of suggested text

@garrett-eclipse
6 months ago

table inside of suggested text

#3 @garrett-eclipse
6 months ago

  • Keywords has-patch has-screenshots needs-testing added
  • Milestone changed from Awaiting Review to 5.4.1
  • Owner set to garrett-eclipse
  • Status changed from new to accepted
  • Version set to 5.4

In 49772.diff I've worked through several attempts and am now happy with the result and support of plugins that contain alternate elements (ul, ol, table) inside the suggested content.
Along with handling these I've also applied basic styling to the ul/ol to indent and ensure it's prefixed properly with either the disc or numeric.

#4 follow-up: @whyisjake
6 months ago

Looks great @garrett-eclipse. Ready to commit?

This ticket was mentioned in Slack in #core by whyisjake. View the logs.


6 months ago

#6 in reply to: ↑ 4 @garrett-eclipse
6 months ago

Replying to whyisjake:

Looks great @garrett-eclipse. Ready to commit?

For sure, would love some testers to apply the patch and then some 3rd party plugins just to be extra safe here.
Here's a list of plugins using the guide - https://wpdirectory.net/search/01E4VTZDVQY3Y4JJC8T51WGZHW
*WooCommerce, The Events Calendar and other larger ones are the primary focus.

#7 @whyisjake
6 months ago

  • Keywords commit added; needs-testing removed

Looks great. Going to bring to commit to trunk and backport to 5.4.

#8 @whyisjake
6 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 47560:

Privacy: Support additional elements (table, ol, ul) in privacy policy guide new styling

The privacy policy guide supports a lot of HTML, include rules for lists, and ensure proper styling for the rest.

Props garrett-eclipse.
Fixes #49772.

#9 @whyisjake
6 months ago

In 47561:

Privacy: Support additional elements (table, ol, ul) in privacy policy guide new styling

The privacy policy guide supports a lot of HTML, include rules for lists, and ensure proper styling for the rest.

Backports the trunk commit to the 5.4 branch.

Props garrett-eclipse.
Fixes #49772.

Note: See TracTickets for help on using tickets.