hasContent(Markdown::type[0])) { $pageMarkdownContent = PageMeta::$page->getContent(Markdown::type[0]); $length = strlen($pageMarkdownContent); for ($i=0; $i<$length; $i++) { if (empty(trim($pageMarkdownContent[$i]))) { continue; } else if ($pageMarkdownContent[$i] == '#' && $pageMarkdownContent[$i+1] != '#') { break; } echo "\n"; echo "

".PageMeta::$page->getName()."

\n"; break; } } $parsers = array( new HTML(), new Markdown(), new LaTeX(), new ReST() ); $htmlContent = null; foreach ($parsers as $parser) { $ok = false; foreach ($parser->type() as $suffix) { if (PageMeta::$page->hasContent($suffix)) { $htmlContent = $parser->parse(PageMeta::$page->getContent($suffix)); $ok = true; } } if ($ok) break; } echo $htmlContent;