Extension talk:Html2Wiki

From mediawiki.org

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

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

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


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.

Piet

XAMPP[edit]

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

REPLY[edit]

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

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

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

Pandoc not being detected/CentOS 7 Setup[edit]

On MediaWiki v1.34 - Got Pandoc working from the shell, but Html2Wiki is not detecting it.

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

Dry run[edit]

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

Error message[edit]

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

Solved — Ciciban (talk) 10:29, 28 September 2016 (UTC)Reply

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

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

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

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>
<html>
<head>
<title>Demo</title>
</head>
<body>
<p>Hallo Welt! Hier bin ich!</p>
</body>
</html>

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

---

Are there any news regarding this issue? Having the exact same problem and there are sadly neither warnings nor errors in the php logs. Im using Bluespice 3.2.5 built on the MediaWiki Version 1.31.15 with PHP 7.4.0. KAWAII BAAAKA

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

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]

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

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

Backtrace:

#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)Reply

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

Backtrace:

#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)Reply

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?

/ changes to %2F when importing from multiple folders[edit]

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

https://whydontrussianssmile.com/index.php/Special:Version

Any suggestions why?

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

Html2Wiki and MediaWiki 1.35: A Temporary Solution?[edit]

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.