Page MenuHomePhabricator

in tables an empty bgcolor attribute is parsed suboptimally
Closed, ResolvedPublic

Description

Compare the first two cells in row 1 of the table at https://en.wikipedia.org/w/index.php?title=User:Thryduulf/sandbox&oldid=566470353#Table where the Wikicode

-
bgcolor=""row 1, cell 1
bgcolorrow 1, cell 2

produces:

<tr>
<td bgcolor="">row 1, cell 1</td>
<td bgcolor="bgcolor">row 1, cell 2</td>

Row 1 cell 1 is rendered with the light grey background colour defined in the wikitable class. Row 1 cell 2 is rendered with a dark red background colour (#b00000)

The desired behaviour is that both should produce the html <td bgcolor="">


Version: unspecified
Severity: normal

Details

Reference
bz52330

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:08 AM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz52330.
bzimport added a subscriber: Unknown Object (MLST).

From Sanitizer::getTagAttributeCallback:

  1. In XHTML, attributes must have a value.
  2. For 'reduced' form, return explicitly the attribute name here.

Works as aspected, but it the aspected right?

That behaviour might be what is expected from the code specification, but the output it isn't what the end user expects.

This is causing a difference vs. Parsoid, so it would be good to fix this in PHP. See also bug 51954.

Change 223346 had a related patch set uploaded (by Arlolra):
Empty attribute syntax

https://gerrit.wikimedia.org/r/223346

Change 223346 merged by jenkins-bot:
Empty attribute syntax

https://gerrit.wikimedia.org/r/223346

Arlolra claimed this task.