Extension talk:Html2Wiki

From MediaWiki.org
Jump to navigation Jump to search

PLEASE Report any issues using Phabricator, not here.

You can also search issues on the Workboard

Issue with MW 1.24.1[edit]

I cannot get it working for following version. Html2Wiki: REL1_31 2018-04-17T22:17:29


I still get following error: mediawiki_1 | [Thu Dec 13 14:34:57.887909 2018] [php7:warn] [pid 61] [client] PHP Warning: require_once(/opt/bitnami/mediawiki/extensions/Html2Wiki/Html2Wiki.php): failed to open stream: No such file or directory in /bitnami/mediawiki/LocalSettings.php on line 143, referer: https://localhost/index.php/Main_Page mediawiki_1 | [Thu Dec 13 14:34:57.888040 2018] [php7:error] [pid 61] [client] PHP Fatal error: require_once(): Failed opening required '/opt/bitnami/mediawiki/extensions/Html2Wiki/Html2Wiki.php' (include_path='/opt/bitnami/mediawiki/vendor/pear/console_getopt:/opt/bitnami/mediawiki/vendor/pear/mail:/opt/bitnami/mediawiki/vendor/pear/mail_mime:/opt/bitnami/mediawiki/vendor/pear/mail_mime-decode:/opt/bitnami/mediawiki/vendor/pear/net_smtp:/opt/bitnami/mediawiki/vendor/pear/net_socket:/opt/bitnami/mediawiki/vendor/pear/pear-core-minimal/src:/opt/bitnami/mediawiki/vendor/pear/pear_exception:.:/opt/bitnami/php/lib/php') in /bitnami/mediawiki/LocalSettings.php on line 143, referer: https://localhost/index.php/Main_Page

For some reason I can't get the extension to show up on the Special Pages. I get the following error message when entering "http://localhost/mediawiki/index.php/Special:Html2Wiki":

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";
require_once "$IP/extensions/Html2Wiki/Html2Wiki.php";
$wgScriptPath = "/mediawiki"; # Default installation
Entry point URLs
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
Installed skins
Metrolook 2.5 GPLv2+ Metrolook skin for MediaWiki ...
Installed extensions
SyntaxHighlight ...
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[edit]


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[edit]

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é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)

REPLY: try change the htmlqp() to html5qp() in file Html2Wiki/Specials/SpecialHtml2Wiki.php

Embed Mindjet HTML (Mindmanager export) into wiki page[edit]

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.



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)


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?[edit]

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)[edit]

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[edit]

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[edit]

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

Dry run[edit]

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[edit]

Dear everypody,
I just tried to install the extension.
composer install

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[edit]

In PAGENAME#Install 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[edit]

(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[edit]

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>
<p>Hallo Welt! Hier bin ich!</p>

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[edit]

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[edit]

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[edit]


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[edit]

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


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

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

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

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

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

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

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

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

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

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

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

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

#12 {main}

I managed getting rid of it by editing line 814 in /path_to_my_wiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php

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 /path_to_my_wiki/languages/Language.php from line 4828 to 4830 :

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

Hope this helps.

Kifit (talk) 20:20, 17 August 2018 (UTC)

Mediawiki 1.31 : cannot import HTML from ZIP archives[edit]

While trying to import HTML from ZIP archive, I encountered the following error :

[a2037b24fe1f1b9700a0ef3d] /index.php?title=Sp%C3%A9cial:Html2Wiki&action=submit Error from line 711 of /var/www/wiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php: Call to undefined function zip_open()


#0 /var/www/wiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(650): SpecialHtml2Wiki->unwrapZipFile()
#1 /var/www/wiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(519): SpecialHtml2Wiki->doUpload()
#2 /var/www/wiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(220): SpecialHtml2Wiki->doImport()
#3 /var/www/wiki/includes/specialpage/SpecialPage.php(522): SpecialHtml2Wiki->execute(NULL)
#4 /var/www/wiki/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)
#5 /var/www/wiki/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)
#6 /var/www/wiki/includes/MediaWiki.php(861): MediaWiki->performRequest()
#7 /var/www/wiki/includes/MediaWiki.php(524): MediaWiki->main()
#8 /var/www/wiki/index.php(46): MediaWiki->run()
#9 {main}

This was caused by missing ZIP extension in PHP.

As I'm using PHP 7.0 with PHP-FPM, I managed getting rid of the error with the following commands (for Debian and derivatives) :

sudo apt install php7.0-zip
sudo service php7.0-fpm restart

HTML import from zip files is now working fine.

This looks like a missing dependency and should be either fixed or mentioned on the extension page.

Kifit (talk) 13:07, 19 August 2018 (UTC)

Import stops at Copyright or Registered Symbols[edit]

I can import content from an html file but the process stops when a copyright or registered symbol is encountered. It looks like it is stopping on all & symbols. How do I resolve this?