Default installations to using RemexHtml for tidying
authorJames D. Forrester <jforrester@wikimedia.org>
Wed, 4 Apr 2018 17:18:56 +0000 (10:18 -0700)
committerJames D. Forrester <jforrester@wikimedia.org>
Thu, 5 Apr 2018 17:30:07 +0000 (10:30 -0700)
This combines two changes â€“ defaulting tidying to on, previously off, and
defaulting the tidying library to RemexHtml, previously the tidy binary.
Config options are going to be a bit of a mess until we drop support for
the old tidy binary config route.

Bug: T185753
Depends-On: I0a8973f508fbf65160177b003260831639828eea
Change-Id: I6879a77a78d780c7c056d807dde20682c6097d1a

RELEASE-NOTES-1.31
includes/DefaultSettings.php
tests/phpunit/includes/parser/TidyTest.php

index 23afa4f..b467449 100644 (file)
@@ -31,6 +31,10 @@ production.
 * (T188472) The 'comma' value for $wgArticleCountMethod is no longer supported for
   performance reasons, and installations with this setting will now work as if it
   was configured with 'any'.
+* (T185753) MediaWiki now defaults to using RemexHtml to tidy up user input, rather than
+  being off by default. If you wish to disable HTML tidying entirely, set $wgTidyConfig
+  to null; if you wish to use the old, deprecated Tidy external binary, both
+  set $wgTidyConfig to null and also set $wgUseTidy to true.
 * $wgLogAutopatrol now defaults to false instead of true.
 
 === New features in 1.31 ===
index c000098..0a499a3 100644 (file)
@@ -4270,8 +4270,9 @@ $wgAllowImageTag = false;
 
 /**
  * Configuration for HTML postprocessing tool. Set this to a configuration
- * array to enable an external tool. Dave Raggett's "HTML Tidy" is typically
- * used. See https://www.w3.org/People/Raggett/tidy/
+ * array to enable an external tool. By default, we now use the RemexHtml
+ * library; historically, Dave Raggett's "HTML Tidy" was typically used.
+ * See https://www.w3.org/People/Raggett/tidy/
  *
  * If this is null and $wgUseTidy is true, the deprecated configuration
  * parameters will be used instead.
@@ -4292,7 +4293,7 @@ $wgAllowImageTag = false;
  *  - tidyBin: For RaggettExternal, the path to the tidy binary.
  *  - tidyCommandLine: For RaggettExternal, additional command line options.
  */
-$wgTidyConfig = null;
+$wgTidyConfig = [ 'driver' => 'RemexHtml' ];
 
 /**
  * Set this to true to use the deprecated tidy configuration parameters.
index 62b84aa..be5125c 100644 (file)
@@ -55,8 +55,8 @@ MathML;
                                '<editsection> should survive tidy'
                        ],
                        [ '<mw:toc>foo</mw:toc>', '<mw:toc>foo</mw:toc>', '<mw:toc> should survive tidy' ],
-                       [ "<link foo=\"bar\" />\nfoo", '<link foo="bar"/>foo', '<link> should survive tidy' ],
-                       [ "<meta foo=\"bar\" />\nfoo", '<meta foo="bar"/>foo', '<meta> should survive tidy' ],
+                       [ "<link foo=\"bar\" />foo", '<link foo="bar"/>foo', '<link> should survive tidy' ],
+                       [ "<meta foo=\"bar\" />foo", '<meta foo="bar"/>foo', '<meta> should survive tidy' ],
                        [ $testMathML, $testMathML, '<math> should survive tidy' ],
                ];
        }