Page MenuHomePhabricator

<code> is escaped inside <pre>
Closed, DeclinedPublic

Description

Author: bugs

Description:
Hi there,

This seems like it should be a known issue since it's so obvious, but i could not find any information on it, and nobody on IRC seemed to know either. Sorry if this is redundant :)

The issue is basically as it says in the title: When <code>...</code> is included within a <pre>, MediaWiki escapes the former. For example:

<pre><code> test</code></pre>

becomes

<code> test</code>

This is not how it should work according to the W3C:

http://www.w3.org/TR/html401/struct/text.html#h-9.3.4

http://www.w3.org/TR/html5/grouping-content.html#the-pre-element

In fact, MediaWiki seems to escape *everything* inside <pre> (whilst the W3C indicates that there are only a handful of elements that are not allowed there) — making it essentially a white-space-preserving <nowiki>.

Is there a specific reason for this? Is it possible to change?

cheers


Version: 1.16.x
Severity: normal

Details

Reference
bz28659

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 21 2014, 11:36 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz28659.
bzimport added a subscriber: Unknown Object (MLST).

Wikimarkup is not html. If you want that behaviour use empty space at the beginning of the line.