Page MenuHomePhabricator

Leading spaces in <pre> block render incorrectly when block preceded by another <pre>
Open, LowPublic

Description

Author: mediazilla

Description:

<pre></pre><pre>
                     Already in a pre block
                     ----------------------
Fully aligned to the left w/o any spaces
 Indented by a space
 Another indented line
</pre>

Result:

image.png (831×1 px, 22 KB)

The text above makes blocks inside of a block. If the first set of pre's are
removed then the 2nd set of pre's work correctly.

URL: http://en.wikipedia.org/wiki/User:Simetrical/3230

See also:

Details

Reference
bz3230

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 8:46 PM
bzimport set Reference to bz3230.
bzimport added a subscriber: Unknown Object (MLST).

mediazilla wrote:

To see the above example you have to indent some of the lines

gangleri wrote:

Hallo!

Is this the same bug as at
http://yi.wikipedia.org/w/index.php?title=MediaWiki:Monobook.css&oldid=12697 ?

Please take a look at the workaround at
http://yi.wikipedia.org/w/index.php?title=MediaWiki:Monobook.css&diff=12698&oldid=12697

Until now I used both <pre> and </pre> only at the beginning of lines. In the
example from comment 0 and at the new example this is not the case. It seams
that the second ocurence fails.

best regards reinhardt [[user:gangleri]]

robchur wrote:

Sample input that produces the problem

Some sample markup that will produce the problem.

Attached:

robchur wrote:

Screenshot of the broken rendering

Screenshot of the broken rendering that attachment 2920 is parsed to.

Attached:

Broken_rendering.png (322×354 px, 33 KB)

ayg wrote:

HTML output of sample (from Wikipedia)

That's not the output I see. See URL. Attachment shows the HTML output I get:
the <pre>s aren't nested, the first one terminates when the second one starts.
Is this because of Tidy, maybe? Where did you get your test sample from? It's
buggy either way, at any rate.

Attached:

Izno subscribed.

The screenshot is how Remex is rendering this.

The input, as above, is

<pre></pre><pre>
We're in a pre block
 One space in
  Two spaces
  Two again
   Three spaces
    Four
  Two
 One
None
</pre>

ayg (Simetrical?)'s output HTML is no longer what is being output, which is now:

<pre></pre><pre><p>We're in a pre block
</p>
<pre>One space in
 Two spaces
 Two again
  Three spaces
   Four
 Two
One
</pre>
<p>None
</p>
</pre>

I am a bit puzzled about the extra pre here.

This seems to be fixed in Parsoid.