Don't run the non-Tidy "bug 2702" hack unless Tidy is really missing
authorTim Starling <tstarling@wikimedia.org>
Thu, 7 Jul 2016 23:42:50 +0000 (09:42 +1000)
committerTim Starling <tstarling@wikimedia.org>
Wed, 27 Jul 2016 04:47:36 +0000 (14:47 +1000)
commit134f8c451323663c466d985823effeec585d4e8f
tree2cd2bbdf8ad64019f6fdf44e3364a384e070752c
parenta4d737f22942d71252ad78e18d0221a581ed455e
Don't run the non-Tidy "bug 2702" hack unless Tidy is really missing

We have two hacks which are used when Tidy is not available: one in
Sanitizer::removeHTMLtags(), and the second here as a late Parser pass
equivalent to Tidy itself. But the Sanitizer one was enabled only if
MWTidy::isEnabled() returned false, whereas the Parser one was enabled
also when tidy was disabled in ParserOptions. This patch makes them both
consistent, it enables the bug 2702 hack only when MWTidy::isEnabled()
returns false, and when Tidy is disabled in parser options, the output
is simply passed through.

This allows tidying to be done separately on the ParserOutput, as is
required by the proposed ParserMigration extension (I24d0776a933fa3f).

Eventually the bug 2702 hack will be removed in favour of a pure-PHP
HTML 5 parser, but it looks like it is too early for that.

Change-Id: I94be6c9dec531c23ef80cb36732243bd6858bf22
RELEASE-NOTES-1.28
includes/parser/Parser.php