getConfig()->getDefaultContextPath()->getWikiId(); } try { /** * Fragment */ $ACT = ExecutionContext::PREVIEW_ACTION; $modes = p_get_parsermodes(); $handler = new Doku_Handler(); $parser = new \dokuwiki\Parsing\Parser($handler); //add modes to parser foreach ($modes as $mode) { $parser->addMode($mode['mode'], $mode['obj']); } $parser->parse($markup); return $handler; } finally { $ID = $keep; $ACT = $keepAct; } } }