Search code examples
phpmediawikipearmarkuptext-processing

Converting Wiki Markup to Plain Text


Using Pear Wiki package, I tried using following code to convert some media wiki to plain text, but it does not work as expected. What is wrong with it?

require_once "Text/Wiki/Mediawiki.php";
$p=new Text_Wiki_Mediawiki();

echo $p->transform('==a title==[[ a link]]','plain');

// I expect "a title a link" but it returns: "==a title==[[ a link]]"

Solution

  • Oh, this package built path to class dynamically and throw no exception. In addition to PEAR Text_Mediawiki package you should also get core PEAR packages and add its path to include_path.