function Html5SetSpamMessage($match = false) { Html5editor::$spam_message = wfMsg('spamprotectiontext'); if ($match) { Html5editor::$spam_message .= wfMsgExt('spamprotectionmatch', 'parse', wfEscapeWikiText($match)); } return true; }
function process($title) { global $wgOut, $wgTitle; $rev = Revision::newFromTitle($title); if (!$rev) { continue; } #echo "Checkng {$title->getText()}\n"; $text = $rev->getText(); $oldtext = $text; wfRunHooks('ArticleBeforeOutputWikiText', array(&$article, &$text)); $html = $wgOut->parse($text); $wgTitle = $title; $html = WikihowArticleHTML::postProcess($html, array('no-ads' => 0)); $editor = new Html5editor(); $newtext = $editor->convertHTML2Wikitext($html, $oldtext); echo "{$title->getFullURL()} - {$title->getArticleID()}\n"; }
<?php require_once 'commandLine.inc'; $h5e = new Html5editor(); $html = file_get_contents($argv[0]); $newtext = $h5e->convertHTML2Wikitext($html, ""); echo $newtext;