Page MenuHomePhabricator

First tab character in a preformatted paragraph converted to wrong number of spaces
Closed, ResolvedPublic

Description

Author: x00000000

Description:
This wiki syntax (the columns are separated by single tab characters):

1	a	a	a
2	b	b	b
3	c	c	c
4	d	d	d
5	e	e	e

will be formatted as:

1  a       a       a
2       b       b       b
3       c       c       c
4       d       d       d
5       e       e       e

<pre/> works correctly if the start tag is on its own line, but not if the first line is prepended by it. The following code produces the same output as wiki syntax:

<pre>1	a	a	a
2	b	b	b
3	c	c	c
4	d	d	d
5	e	e	e</pre>

I suspect that the tab-to-space converting algorithm incorrectly doesn't remove the leading <pre> before calculating the position of the tab stops, and that wiki syntax is converted to this <pre> version internally before tab-to-space conversion.

URL: http://smorgasbord.local/trunk/index.php/Tabby

Details

Reference
bz12751

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:02 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz12751.
bzimport added a subscriber: Unknown Object (MLST).

I'm guessing this is an issue with the HTML Tidy postprocessing.

On my local machine, everything looks good with or without Tidy; Tidy translates the raw tabs to spaces, but appears to do it "correctly", or at least consistently. On live Wikipedia, I get the results described. (Added sample URL http://smorgasbord.local/trunk/index.php/Tabby )

So this may be a matter of upgrading Tidy etc.

x00000000 wrote:

I just observed this bug on de.wikipedia.org and verified it on test.wikipedia.org; I don't have a own MediaWiki installation.

Indeed I can reproduce this bug with Tidy, however not only with the 2005-10-26 version (last packaged distribution), but also with the latest CVS version. I filed a bug against Tidy: http://sourceforge.net/tracker/index.php?func=detail&aid=1885471&group_id=27659&atid=390963

A workaround in MediaWiki would be to output a '\n' after the <pre> when converting wiki syntax to HTML.

Izno claimed this task.
Izno subscribed.

This is fixed by Remex if not some version of Tidy between now and 2008.