Page MenuHomePhabricator

HTML attributes not preserved on <pre> tags
Closed, ResolvedPublic

Description

Author: d.oliver

Description:
In Sanitizer.php, <pre> tags are allowed to have $common+'width' attributes. However, in Parse.php <pre> tags
appear to be stripped unconditionally of all attributes.

I would like to be able to specify the class of a <pre> tags, so for now I have commented out the appropriate
lines in Parse.php.

Could the status of <pre> tags be clarified?

Thanks,
Dan.


Version: 1.5.x
Severity: normal

Details

Reference
bz3202

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:47 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz3202.

<pre> in wikitext is not actually an HTML element, but a wikitext extension; for
instance links are not formatted inside <pre> sections.

The handler would need to check its attribute parameters separately from the main
Sanitizer code and re-add them in its output.

Changing subject line.

Will handle this along with updated parser code...

  • Bug 3935 has been marked as a duplicate of this bug. ***

Parser test added in r14623.
Fix in r14624.

stanley wrote:

Can you also applied this to MediaWiki 1.6 please.