Page MenuHomePhabricator

$wgCleanupPresentationalAttributes: 'align' parameter for tables is replaced with wrong CSS
Closed, ResolvedPublic

Description

With $CleanupPresentationalAttributes=true (default in 1.19) 'align' parameters are replaced with 'text-align' CSS.

This works for <div>, BUT for a <table> this is wrong (since 'text-align' affects only the text inside the table, and <table align="center">...</table> has the same effect as <center><table>...</table></center>).

I suggest that the 'align' parameters for tables should be left intact (even with $CleanupPresentationalAttributes=true).

The alternative is to replace 'align=right' and 'align=left' by 'float: (right/left)' style, and 'align=center' by wrapping the table into the <center> tag.


Version: 1.19
Severity: normal

Details

Reference
bz36586

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:27 AM
bzimport set Reference to bz36586.
bzimport added a subscriber: Unknown Object (MLST).

Probably better replacement:

align=right -> style="margin-left: auto;"

align=left -> style="margin-right: auto;"

align=center -> "margin-right: auto; margin-left: auto;"

ek79501 wrote:

I can confirm this bug. Two other bugs were submitted for this same issue:
https://bugzilla.wikimedia.org/show_bug.cgi?id=36495
https://bugzilla.wikimedia.org/show_bug.cgi?id=37114

We can keep this one as the "main" one since a solution is suggested although I don't know enough to say if that's the best solution or not so they'll have to test it.

  • This bug has been marked as a duplicate of bug 36495 ***