コード例 #1
0
ファイル: Html5editor.php プロジェクト: biribogos/wikihow-src
function Html5SetSpamMessage($match = false)
{
    Html5editor::$spam_message = wfMsg('spamprotectiontext');
    if ($match) {
        Html5editor::$spam_message .= wfMsgExt('spamprotectionmatch', 'parse', wfEscapeWikiText($match));
    }
    return true;
}
コード例 #2
0
ファイル: test_html5.php プロジェクト: biribogos/wikihow-src
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";
}
コード例 #3
0
ファイル: html5debug.php プロジェクト: biribogos/wikihow-src
<?php

require_once 'commandLine.inc';
$h5e = new Html5editor();
$html = file_get_contents($argv[0]);
$newtext = $h5e->convertHTML2Wikitext($html, "");
echo $newtext;