Manual talk:$wgUseTidy

Really Unhelpful Page
This page doesn't contain any helpful information. How do I point Mediawiki to the tidy executable? How do I set the path for MediaWiki so it can find HTML tidy? Where is the default configuration file located? Where can I get HTML Tidy from? This information should all be on this page, but none of it actually is.

97.117.112.73 06:10, 23 October 2010 (UTC)

Example Tidy Configuration File
It appears that a valid configuration file for Tidy is required, using the default installed on a server either doesn't work or it has the incorrect settings. So a valid one needs to be provided. The error noted below was due to this. The configuration file used is noted below (located at /extensions/tidy/tidy.conf), which was found at Data dumps. Ensure that the Manual:%24wgTidyConf is correctly set to the location of the configuration file.

show-body-only: yes force-output: yes tidy-mark: no wrap: 0 wrap-attributes: no literal-attributes: yes output-xhtml: yes numeric-entities: yes enclose-text: yes enclose-block-text: yes quiet: yes quote-nbsp: yes fix-backslash: no fix-uri: no

Breaking HTML Code
I have enabled UseTidy on my wiki and it has broken some of the HTML generated to display pages. It is influencing the coding associated with displaying images. Initially I thought it was only to do with the RandomImage extension, but now know that it effects every single image that is displayed in the wiki.

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 code was working fine before enabling $wgUseTidy.

An example of the coding that now appears incorrectly on the pages is as follows. Not sure how to make it not convert the code to a > though. It is on the end of this line: ".... nsitional.dtd" & gt;".

   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"& gt; < /pre > 4,500 K

If interested, reason for using UseTidy can be found here: Meta-Wiki: Talk: ParserFunctions: Further HTML Tables Problems

This is on an intiallation of MediaWiki 1.8.2 --Dr DBW 23:53, 7 December 2006 (UTC)


 * Further information, it appears that this only effects image coding that is generated by the gallery tag or the RandomImage extension. Normal images within the pages is fine.  So it appears that the code made by those two parts, something is wrong that causes the Tidy script to cause problems. --Dr DBW 22:14, 19 December 2006 (UTC)


 * This is still an issue. Anyone with suggestions on what to try, where to ask, who etc? --Dr DBW 22:59, 8 February 2007 (UTC)


 * Upgraded to 1.9.3 and the problem still occurs --Dr DBW 23:48, 27 February 2007 (UTC)


 * Have submitted a bugzilla for this issue 9235 --Dr DBW 02:59, 9 March 2007 (UTC)


 * SOVLED !!! This is an issue due to not being able to find a configuration file, or not having a valid configuration file in use. --Dr DBW 03:38, 13 March 2007 (UTC)

What an absolutely maddening problem! I've been working on this exact same problem for two days before finding this page. A big thanks to everyone who found the solution. Todd 6, April, 2007.


 * You have got that right. Anyway, with some further releases coming up, a default configuration file is going to be included in the distribution, it is noted in the bugzilla above if interested. --Dr DBW 04:48, 12 April 2007 (UTC)

Parser.php Error
Some of my templets & codes were breaking the page. I was trying to fix this problem last couple of days but not yet solved. As a last hope I used following to my local setting page: $wgUseTidy=true; $wgTidyBin = '/usr/bin/tidy'; $wgTidyConf = $IP.'/extensions/tidy/tidy.conf'; Now, my page looks ok but showing following error Warning: proc_open [function.proc-open]: open_basedir restriction in effect. File(/dev/null) is not within the allowed path(s): (/home:/tmp:/usr) in /home/.../public_html/includes/Parser.php on line 759

Warning: proc_open(/dev/null) [function.proc-open]: failed to open stream: Operation not permitted in /home/.../public_html/includes/Parser.php on line 759 What went wrong? Please help me to slove this problem. Thanks.--Usingha 02:36, 18 October 2007 (UTC)
 * This problem is solved by fixing the path and installing new tidy 2.0. Thanks--Usingha 02:54, 8 December 2007 (UTC)

wich tidy to use?
Q: apt-cache search tidy prints several tidy results. Two of them seem to be interesting:


 * php5-tidy (libtidy-0.99-0)
 * tidy

My guess is that tidy is the prefered choice, but how about php5-tidy? Could this be an interesting alternative? Are there individuals out there with any experience with this module?

-Kaspera 11:17, 2 November 2007 (UTC)

$wgUseTidy hangs MediaWiki
In our environment enabling $wgUseTidy can cause all of our wiki to lock-up. To reproduce, we can simply enable tidy, then (in Firefox) rapidly ctrl-click "Random Page" to open a bunch of tabs for the wiki. At some point (usually after the 2nd or 3rd tab loads) the rest of the tabs just sit there, not loading... timing out in several minutes with a 1205: Lock wait timeout exceeded error.

On the server end, when the hang occurs, one of the httpd.exe processes is well over 100MB (it is usually around 70-80MB) and several cmd.exe processes have been spawned. Process Explorer shows the cmd.exe processes as children of httpd.exe, but has no information regarding who/how it was called. While Mediawiki is inaccessible... our phpBB3 installation, served from the same Apache/MySQL/PHP instance, works fine.

To resume normal operations, the httpd.exe process has to be killed and restarted. The cmd.exe processes disappear when httpd.exe is killed.

I have tried downloading the newehttp://upload.wikimedia.org/wikipedia/commons/c/c8/Button_redirect.pngst Tidy 2.0 executable and specifying it in the localsettings.php, but it still breaks. I've tried specifying the tidy.conf file explicitly, but it still breaks. The only way I have been able to avoid the hangs is to disable tidy (comment out $wgUseTidy = true;).

Our environment: Windows 2003 SP1 WAMP: Apache 2.2.8 PHP 5.2.6 MySQL 5.0.51b Mediawiki 1.12.0 (r3238) phpBB3 3.0.1

Any else seen this type of problem with tidy and Mediawiki? Cedarrapidsboy 14:55, 8 July 2008 (UTC)
 * It also seems I can use the following without a problem, so it may only be a problem with the external (exe) tidy spawning:

$wgUseTidy = true; $wgTidyInternal = true;
 * NOTE: I had to enable PHP's php_tidy extension and restart Apache.
 * If I read the docs right, this uses PHP's internal tidy algorithms instead of launching the tidy binary to do the work. Cedarrapidsboy 15:08, 8 July 2008 (UTC)


 * I have the same problem with this Tidy, only it works well when we don't use it, but it is necessary for templates.--189.182.163.13 05:27, 18 September 2009 (UTC)