Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#29433 closed defect (bug) (fixed)

KSES should allow colgroup

Reported by: westi Owned by: nacin
Milestone: 4.1 Priority: normal
Severity: normal Version: 4.0
Component: Formatting Keywords: good-first-bug has-patch kses 4.1-early
Focuses: Cc:


We allow users without unfiltered_html to use the col element but not the colgroup element.

TinyMCE strips out col elements that are not inside colgroups ...

The col element seems supported in TinyMCE. However, It has "weird" rules: can only be a child of a colgroup element, which can only be a child of a table element and can only be at the top of the table before thead, tfoot, tbody but after caption. Ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/col and https://developer.mozilla.org/en-US/docs/Web/HTML/Element/colgroup.

The difference in TinyMCE is that it is "strict". It requires that col elements are always inside a colgroup.

It looks like adding:

		'colgroup' => array(
			'align' => true,
			'char' => true,
			'charoff' => true,
			'span' => true,
			'valign' => true,
			'width' => true,

to the KSES config for posts will resolve this.

Attachments (1)

29433.patch (414 bytes) - added by collinsinternet 6 years ago.
Adding colgroup to the $allowedposttags array.

Download all attachments as: .zip

Change History (7)

6 years ago

Adding colgroup to the $allowedposttags array.

#1 @collinsinternet
6 years ago

  • Keywords has-patch added; needs-patch removed

#2 @miqrogroove
6 years ago

  • Component changed from Editor to Formatting
  • Keywords kses added

#3 @helen
6 years ago

  • Keywords 4.1-early added
  • Milestone changed from Awaiting Review to Future Release

#4 @SergeyBiryukov
6 years ago

  • Milestone changed from Future Release to 4.1

#5 @nacin
6 years ago

Since we haven't supported it before, I was going to suggest we don't add attributes that were not only obsoleted in HTML 5, but also deprecated in HTML 4.01. That would leave just span and width as attributes. However, we have them for col, tbody, etc., and should be consistent.

#6 @nacin
6 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 29740:

kses: Add colgroup.

props collinsinternet.
fixes #29433.

Note: See TracTickets for help on using tickets.