Page MenuHomePhabricator

UseTidy breaks code generated by Gallery tag
Closed, InvalidPublic

Description

Author: dbw

Description:
Due to current rendering issues with tables / if statements etc, needed to
enable $UseTidy.

When this is done, the image table generated by the <gallery></gallery> tag gets
messed up. It is also a problem with the RandomImages extension (suspect they
use the same code somewhere).

What appears to be happening is that some of the opening and closing tags of the
code is generated as & gt; or & lt;. Which then means that things fail, get
funny bits of code appearing on the page etc. The gallery generating code was
working fine before enabling $wgUseTidy.

Because of the tags being messed up, the following is visible under the
thumbnails generated by the gallery tag (as well as with RandomImage):
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

More details of it are documented here -
http://www.mediawiki.org/wiki/Manual_talk:%24wgUseTidy

Problem since noticed it with 1.8.2.

What it looks like when viewed using Firefox: http://ozreef.org/stuff/Screenshot.png

What it looks like when viewed using IE:
http://www.project-a.com.au/images/Nathan/Feb07/screengrab1.jpg


Version: 1.9.x
Severity: normal

Details

Reference
bz9235

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:35 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz9235.
bzimport added a subscriber: Unknown Object (MLST).

It looks like you're missing the tidy configuration file.
The default one we provide is in the extensions module, in extensions/tidy.

dbw wrote:

Sorry if this is a stupid question, but I have been searching high and low
(Google, MediaWiki, MetaWiki) for a default tidy configuration file in the
extensions module, and have found nothing. Not even really a mention of one.

Where is this meant to be obtained from?

FYI, Tidy is working, and it is using the configuration file that is the default
for Tidy on the server itself. The configuration file exists, it is in the
default location that tidy looks for the configuration file etc.

Ahh, think I have finally found it:
http://meta.wikimedia.org/wiki/Data_dumps#Common_Problems_and_Solutions under
the heading "After I run importDump.php or mwdumper, the articles are messed up.
Templates are skewed and do not display properly. what can I do?"

Seeing if that is appropriate and fixes the issue.

dbw wrote:

That appears to be it!

Damit, something so simple. I have updated the various locations where i have
made comments about this, that a tidy.conf needs to be included. Will update
some details in the manual about tidy to note that as well.

Note that I've moved the default location for the tidy.conf into
includes/tidy.conf, so as of MediaWiki 1.10 it won't be necessary to fetch
extensions files separately for this.