Last modified: 2005-08-12 04:31:16 UTC
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.
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.