Dear developers,

I’m having problems getting the correctly parsed html code of a wiki page 
stored in a php object (used in a maintenance script). The html output in my 
php code has errors in it. The wiki page, which consists of a variety of 
templates, parser functions, SMW queries, etc, works fine in the browser.

This is the code I'm using to get the html:


class Mailer extends Maintenance {

public function execute() {

//Create parser
$parser = new Parser();
$user = User::newFromName ('User:Admin', $validate= 'valid');
$parserOptions = new ParserOptions( $user , 'en' );

// Get wiki page html
$title = Title::newFromText( $titleString ); //Title string is the wiki page 
which I'm trying to convert to properly parsed html code
$wikiPage = WikiPage::factory( $title );
$wikiText = $wikiPage->getText(Revision::RAW);
$parserOutput = $parser->parse($wikiText, $title, $parserOptions);
$body = $parserOutput->getText(); 


My guess is that Parser.php fails to parse multiple levels of the page syntax, 
which it has to because of the transcluded templates and parser functions used 
on the page. 

Can anyone point me in the right direction as to what goes wrong with my usage 
of Parser.php to get the html code of a wiki page?


Kind regards,
Viktor Schelling



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to