Page MenuHomePhabricator

apply html-tidy only once
Closed, InvalidPublic

Description

right now, tidy is invoked when inserting wiki-formated messages too, by
OutputPage::addWikiText. This is not only redundant, but it also causes problems
when inserting short-messages inline: Tidy expects a block-element as the root,
it will insert <p> tags if no top-level block-element is present. This causes
such messages to be displayed in a new paragraph, like the file size/mime type
message in the example URL I provided. This is also the cause of bug #1337.

Applying tidy only once, to the full page, just before it is returned to the
client, would be much cleaner, avoid problems and save CPU cycles.


Version: 1.6.x
Severity: normal
URL: http://commons.wikimedia.org/wiki/Image:Wikimania-phase4.pdf

Details

Reference
bz3119

Event Timeline

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

Opps, the other bug caused by this is #3117. Sorry about this l33t mistake...

(bugzilla feature request: preview button for bug reports)

Tidy is used to supplement our currently broken HTML normalization
code as a late step in wikitext parsing. As part of parsing, it by
definition can only be used within a given parsed wiki text block.

Note that wiki text blocks are supposed to be self-sufficient block
sections, so adding <p> tags if there was no block element is in fact
desired behavior.

If someone's trying to use multiple blocks on one line, that's a bug
and should be corrected.