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
I cannot get it working for following version. Html2Wiki: REL1_31 2018-04-17T22:17:29

816b6eb

I still get following error: mediawiki_1 | [Thu Dec 13 14:34:57.887909 2018] [php7:warn] [pid 61] [client 172.21.0.1:57712] 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 172.21.0.1:57712] 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 " ": 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)

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

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

Pandoc not being detected/CentOS 7 Setup
On MediaWiki v1.34 - Got Pandoc working from the shell, but Html2Wiki is not detecting it.

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.

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

Mediawiki 1.31 : cannot import HTML from ZIP archives
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

Backtrace:


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

/ changes to %2F when importing from multiple folders
It looks like my mediawiki installation does not handle the upload of multi level folders. Eg when I upload a zip containing the following:


 * document.hml
 * document/image1.jpg

Then the URL to the image is as follows:

wiki.company.com/images/1/1/document%2Fimage1.jpg

The / is thus translated to %2F whereas it should remain / so the url is wiki.company.com/images/1/1/document/image1.jpg

Which setting should I alter to keep the /?

Does not work with MediaWiki	1.27.7 - PHP	5.6.40 (litespeed) - MariaDB	10.3.23-MariaDB-log-cll-lve
https://whydontrussianssmile.com/index.php/Special:Version

Any suggestions why?

Thanks Infinitepeace (talk) 06:46, 5 September 2020 (UTC)

Html2Wiki and MediaWiki 1.35: A Temporary Solution?
As many have noted Html2Wiki is broken in its default state with MediaWiki 1.35, as it fails with an error along the lines of 'checkEnvironment is not callable'. It appears that all that is needed in order to get it at least minimally working again is (re-)insertion of the following lines into specials/SpecialHtml2Wiki.php under the plugin's directory within extensions/:

static function checkEnvironment { global $wgNamespacesWithSubpages; if ( $wgNamespacesWithSubpages[NS_MAIN] !== true ) { die( "This extension requires \$wgNamespacesWithSubpages set to TRUE in the MAIN namespace.               Please add \n                \$wgNamespacesWithSubpages[NS_MAIN] = true;\n to your LocalSettings.php" ); }

As obtained from (https)phabricator.wikimedia.org/T196444. Once this function has been re-inserted, at least activation of the plugin in LocalSettings.php will not break MW, and will enable some level of import of HTML content into a MW instance; it is unclear whether the plugin is functioning fully/as intended however.