Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#29433 closed defect (bug) (fixed)

KSES should allow colgroup

Reported by: westi's profile westi Owned by: nacin's profile 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:

Description

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 10 years ago.
Adding colgroup to the $allowedposttags array.

Download all attachments as: .zip

Change History (7)

@collinsinternet
10 years ago

Adding colgroup to the $allowedposttags array.

#1 @collinsinternet
10 years ago

  • Keywords has-patch added; needs-patch removed

#2 @miqrogroove
10 years ago

  • Component changed from Editor to Formatting
  • Keywords kses added

#3 @helen
10 years ago

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

#4 @SergeyBiryukov
10 years ago

  • Milestone changed from Future Release to 4.1

#5 @nacin
10 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
10 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.