Extension talk:Html2Wiki

PLEASE Report any issues using Phabricator, not here.

You can also search issues on the Workboard

Issue with MW 1.24.1
For some reason I can't get the extension to show up on the Special Pages. I get the following error message when entering " ": No such special page You have requested an invalid special page. A list of valid special pages can be found at Special pages.

What I have, and have done is: MediaWiki 1.24.1 PHP      5.4.35 (apache2handler) MySQL 	 5.5.40 require_once "$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php"; $wgNamespacesWithSubpages[NS_MAIN]=true; require_once "$IP/extensions/Html2Wiki/Html2Wiki.php"; $wgScriptPath = "/mediawiki"; # Default installation Entry point	URL Article path	/mediawiki/index.php/$1 Script path	/mediawiki index.php	/mediawiki/index.php api.php		/mediawiki/api.php load.php	/mediawiki/load.php
 * Win7 VMware
 * bitnami mediawiki 1.24.1-0 windows installer. More below.
 * Modified Mediawiki:Common.js (sidebar). Bar OK, but doesn't execute
 * No Apache redirects applied ("clean install")
 * The bitnami stack:
 * Configurations
 * Entry point URLs
 * Installed skins:
 * Metrolook	2.5	GPLv2+	Metrolook skin for MediaWiki	...


 * Installed extensions:
 * SyntaxHighlight	1.0.8.11-wmf1	...
 * Html2Wiki	2015.02	GPL-2.0+	...	Greg Rundlett

Any hints about what to try would be much apprechiated (Needs to test to upload 44.000+ html pages).

// Rolf Lampa

blank page after import button
Hello,

I have an up to date wiki installation. The newest HTML2WIKI version was installed last week with all dependencies. My goal is to import hundrets of html files. I cant even succeed in importing one since the import fails but gives no feedback at all. After choosing the html file as .html or as .zip I press the "Import" Button and get forwarded to a blank screen.

Any experiences with this issue? Also I'm not sure how Tidy, QueryPath and Pandoc have to be installed and configurated on debian and if the extension really makes use of them?

Thanks for your answers in advance.

Encoding problems
Hi, I seem to have encoding problems. After importing a file with "foreign" (non-US) characters, the preview seems to display text as non-UTF-8 7-bit characters. Both the input file and the Wiki are UTF-8.

E.g. "Séminaire" becomes "sÃ©minaire". Only "old-style HTML like S&eacute;minaire would translate to "séminaire".

System and Wiki version: here.

Is there something I did wrong ? Or is this a bug/feature ?

- greetings ! Daniel K. Schneider (talk) 14:31, 24 August 2015 (UTC)

Embed Mindjet HTML (Mindmanager export) into wiki page
Hello, can't find the right solution. How to embed Mindjet Mindmaps into a MediaWiki page? I can handle extensions, but i'm not a nerd. :(

Any idea?

Many thanks for help in advance.

Piet

XAMPP
Hi, I'm trying to install this extension in a local XAMPP, so far I've got Tidy enabled by googling, but I'm now stuck at how to install pandoc. Can anyone point out how to install pandoc on XAMPP? Bennylin (talk) 11:02, 24 May 2016 (UTC)

REPLY
Hey, I had the same problem and it's not too complicated to resolv. If you chceck your phpinfo, I bet there is missing environment var for pandoc. Now check PATH variable in the system, there will be pandoc I believe. So, idk, restart php... better your PC/sign out and in... done.. works! by Cibik

Anchor required?
I've got the extension working on different machine, and based on my experiments, each file has to have at least a link (a href) for the extension to process it? That's a big gotcha there. Bennylin (talk) 07:30, 25 May 2016 (UTC)

import HTML extension (allcaps)
Bug: Importing files with .HTML extension in upper caps (as opposed to .html in lower caps) would generate pagenames with .HTML suffix (as opposed to without suffix). Bennylin (talk) 07:52, 31 May 2016 (UTC)

Pandoc not being detected/Windows Setup
Trying to get HTML2Wiki to work and keep getting stumped with Pandoc being detected by the extension. Everything else installs fine and Pandoc can be used through Command line with no issues, but extension keeps saying to install Pandoc. Tried to remove the requirement out of the PHP which gets rid of the nag screen but when trying to run an Import HTML job it hangs and nothing shows up on the page; I have also tried on two computers (Windows 10 and Windows Server 2012 R2), same results.Any ideas?

-- Had a similar problem, try a restart

Remote file repository
Is this able to upload images to a shared/remote repository as well, like Commons? Nemo 14:30, 14 August 2016 (UTC)

Dry run
Hi, Is there a place to dry run an import? Thank you in advance for your answer. Yours, Ciciban (talk) 15:52, 14 September 2016 (UTC)

Error message
Dear everypody, I just tried to install the extension. composer install delivered
 * [ErrorException] file_put_contents(/var/lib/mediawiki/extensions/Html2Wiki/vendor/composer/installed.js on): failed to open stream: Permission denied

In fact, the directory exists, but the file does not. What should I do abot that? Thank you in advance. Yours, Ciciban (talk) 15:15, 27 September 2016 (UTC)
 * Solved — Ciciban (talk) 10:29, 28 September 2016 (UTC)

Tricky hint
In PAGENAME you tell to add require_once "$IP/extensions/Html2Wiki/Html2Wiki.php"; $wgNamespacesWithSubpages[NS_MAIN] = true; # has to be defined BEFORE the require_once! to LocalSettings.php. After hard trying, I took the comment literally and changed the order of these two lines — and it worked. So, what is the logic of presenting the lines this way? Thank you in advance. Yours, Ciciban (talk) 10:43, 28 September 2016 (UTC)
 * So, as a hint: if you get the message
 * This extension requires $wgNamespacesWithSubpages set to TRUE in the MAIN namespace. Please add $wgNamespacesWithSubpages[NS_MAIN] = true; to your LocalSettings.php
 * on special:version then switch to
 * $wgNamespacesWithSubpages[NS_MAIN] = true; # has to be defined BEFORE the require_once! require_once "$IP/extensions/Html2Wiki/Html2Wiki.php";
 * For me it solved the problem. Yours, Ciciban (talk) 12:08, 28 September 2016 (UTC)

Git it afterwards
(How) Can I skip to Git maintanance after a static installation? Thank you in advance for your answer. Yours, Ciciban (talk) 11:06, 28 September 2016 (UTC)

Html2Wiki creates empty pages
Dear everybody, Meanwhile, I managed to run Html2Wiki. But the created pages are empty. My demo file is named h2m_demo.htm and contains: <!DOCTYPE html> Demo Hallo Welt! Hier bin ich! If I head for Spezial:Html2Wiki, select that file and leave the fields Name der Sammlung oder übergeordneter Pfad, Grund and Trockenlauf empty and hit importieren, the system returns H2w demo was created. See H2w demo h2w_demo.html (114 Bytes) text/html And the page H2w_demo is, as I have mentioned, an empty wiki page: If I hit edit, the source code is: nothing at all. Could you please give me advise how to narrow down the problem? Thank you in advance. Yours, Ciciban (talk) 15:21, 28 September 2016 (UTC)

Error with invalid file format
I have tried loading the latest Html2Wiki extension (both git clone and through the extension download) using MediaWiki 1.29.1, PHP 5.6.31 (cgi-fcgi), and MariaDB 10.0.32-MariaDB.

Whenever I try loading any html file, even a simple hello world example, it shows invalid file format on the upload.

I have tried checking the logs and haven't been able to find anything at all. Any suggestions on what I can try to resolve/debug/check logs?

Compressed files won't upload
Internal error [5a24af1df681d63d8d76fde9] 2018-02-18 05:25:51: Fatal exception of type "Error"

Single html works but even a simple (3 html files) compressed file will not upload.

MediaWiki 1.30 Html2Wiki REL1_30-2cebb1f.tar.gz Apache2 & PHP7

No problems with uploading images thru MediaWiki upload page.

-Bisherbas (talk) 05:28, 18 February 2018 (UTC)

Update:  Problem has been solved. Had to remove all existing PHP versions and installed 7.2 from the scratch.

Tidy installed but stated as missing
Dear

I installed everything as requested on Ubuntu 16 and PHP7.

I got this message

'''Html2Wiki requires Tidy.

You can install the extension with something like sudo apt-get install php5-tidy

Please see the installation instructions at https://www.mediawiki.org/wiki/Extension:Html2Wiki for more info.'''

Tidy is installed. Of course it is php7-tidy and not php5.

Do you need some more information to debug that ?

Regards Thibdx (talk) 14:34, 7 June 2018 (UTC)

-- I think there is a problem with the detection. I went past that point by installing the binary: sudo apt-get install tidy

MediaWiki 1.31 : Error from line 4829 of /var/lib/mediawiki/languages/Language.php
I encountered this exception when trying to use the Html2Wiki extension after upgrading to MediaWiki 1.31 :

[e51f192c19e9217fef6b5ed5] /mediawiki/index.php?title=Special:Html2Wiki&action=submit Error from line 4829 of /var/lib/mediawiki/languages/Language.php: Using $this when not in object context

Backtrace:


 * 1) 0 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(814): Language::formatSize(integer)


 * 1) 1 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(857): SpecialHtml2Wiki->formatValue(integer)


 * 1) 2 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(964): SpecialHtml2Wiki->addFileToResults


 * 1) 3 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(655): SpecialHtml2Wiki->processFile


 * 1) 4 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(519): SpecialHtml2Wiki->doUpload


 * 1) 5 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(220): SpecialHtml2Wiki->doImport


 * 1) 6 /var/lib/mediawiki/includes/specialpage/SpecialPage.php(522): SpecialHtml2Wiki->execute(NULL)


 * 1) 7 /var/lib/mediawiki/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)


 * 1) 8 /var/lib/mediawiki/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)


 * 1) 9 /var/lib/mediawiki/includes/MediaWiki.php(861): MediaWiki->performRequest


 * 1) 10 /var/lib/mediawiki/includes/MediaWiki.php(524): MediaWiki->main


 * 1) 11 /var/lib/mediawiki/index.php(42): MediaWiki->run


 * 1) 12 {main}

I managed getting rid of it by editing line 814 in

I commented out the faulty line and replaced it as bellow :

//       return htmlspecialchars( $this->getLanguage->formatSize( Language::formatSize( $value ) ) ); return htmlspecialchars( $this->getLanguage->formatSize( $value ) );

Html2Wiki is now working fine.

Just for the record, as mentioned in the error message, the "formatsize" function is defined into  from line 4828 to 4830 :

function formatSize( $size ) { return $this->formatComputingNumbers( $size, 1024, "size-$1bytes" ); }

Hope this helps.