Make WordPress Core

Opened 6 years ago

Closed 13 months ago

#51707 closed enhancement (fixed)

Add white-space as an allowed kses CSS attribute.

Reported by: whyisjake Owned by: davidbaumwald
Priority: normal Milestone: 6.9
Component: Formatting Version: 5.3.1
Severity: normal Keywords: has-patch has-unit-tests commit
Cc: Focuses:

Description

white-space has wide browser support, and users would benefit from not having it stripped while adding to posts.

/wp-includes/kses.php:2177

Attachments (2)

51707.diff (329 bytes ) - added by whyisjake 6 years ago.
51707.patch (694 bytes ) - added by mukesh27 6 years ago.
Added doc for "white-space"

Download all attachments as: .zip

Change History (11)

@whyisjake
6 years ago

#1 @mukesh27
6 years ago

  • Keywords has-patch added; needs-patch removed

Patch 51707.diff looks fine for me and white-space support in all latest browser as per https://developer.mozilla.org/en-US/docs/Web/CSS/white-space article.

@mukesh27
6 years ago

Added doc for "white-space"

#2 @hellofromTonya
6 years ago

  • Version trunk5.3.1

#3 @sabernhardt
15 months ago

  • Keywords needs-refresh added

This ticket was mentioned in PR #9197 on WordPress/wordpress-develop by @sukhendu2002.


15 months ago
#4

  • Keywords has-unit-tests added; needs-refresh removed

#5 @sabernhardt
15 months ago

  • Milestone Future Release6.9

@mukesh27 commented on PR #9197:


15 months ago
#6

Thanks @Sukhendu2002 picking and refreshing the patch!

#7 @maxinacube
13 months ago

This looks good to move forward.

Tested in playground environment by adding an inline style of white-space: nowrap|pre|etc.

On save, the style attribute persists as expected.

#8 @davidbaumwald
13 months ago

  • Keywords commit added
  • Owner set to davidbaumwald
  • Status newreviewing

#9 @TimothyBlynJacobs
13 months ago

  • Resolutionfixed
  • Status reviewingclosed

In 60671:

Formatting: Add 'white-space' as an allowed KSES CSS attribute.

The 'white-space' attribute is safe, has wide browser support, and is useful.

Props sukhendu2002, mukesh27, whyisjake..
Fixes #51707.

Note: See TracTickets for help on using tickets.