-
- $text = preg_replace_callback('/<p>{boxTop (.*?)}<\/p>/i', function($m) { return $HTML->boxTop($m[1]); }, $text);
- $text = preg_replace_callback('/{boxTop (.*?)}/i', function($m) { $HTML->boxTop($m[1]); }, $text);
- $text = preg_replace_callback('/<p>{boxMiddle (.*?)}<\/p>/i', function($m) { $HTML->boxMiddle($m[1]); }, $text);
- $text = preg_replace_callback('/{boxMiddle (.*?)}/i', function($m) { $HTML->boxMiddle($m[1]); }, $text);
- $text = preg_replace('/<p>{boxBottom}<\/p>/i', $HTML->boxBottom(), $text);
- $text = preg_replace('/{boxBottom}/i', $HTML->boxBottom(), $text);
-
- $text = preg_replace('/<p>{boxHeader}/i', '<hr />', $text);
- $text = preg_replace('/{boxHeader}/i', '<hr />', $text);
- $text = preg_replace('/{boxFooter}<\/p>/i', '<hr />', $text);
- $text = preg_replace('/{boxFooter}/i', '<hr />', $text);
+ $parsertype = forge_get_config('parser_type', 'blocks');
+ switch ($parsertype) {
+ case 'markdown':
+ require_once 'Michelf/Markdown.inc.php';
+ $text = \Michelf\Markdown::defaultTransform($text);
+ break;
+ default:
+ $text = preg_replace_callback('/<p>{boxTop (.*?)}<\/p>/i', function($m) { global $HTML; return $HTML->boxTop($m[1]); }, $text);
+ $text = preg_replace_callback('/{boxTop (.*?)}/i', function($m) { global $HTML; return $HTML->boxTop($m[1]); }, $text);
+ $text = preg_replace_callback('/<p>{boxMiddle (.*?)}<\/p>/i', function($m) { global $HTML; return $HTML->boxMiddle($m[1]); }, $text);
+ $text = preg_replace_callback('/{boxMiddle (.*?)}/i', function($m) { global $HTML; return $HTML->boxMiddle($m[1]); }, $text);
+ $text = preg_replace_callback('/<p>{boxBottom}<\/p>/i', function($m) { global $HTML; return $HTML->boxBottom($m[1]); }, $text);
+ $text = preg_replace_callback('/{boxBottom}/i', function($m) { global $HTML; return $HTML->boxBottom($m[1]); }, $text);
+
+ $text = preg_replace('/<p>{boxHeader}/i', '<hr />', $text);
+ $text = preg_replace('/{boxHeader}/i', '<hr />', $text);
+ $text = preg_replace('/{boxFooter}<\/p>/i', '<hr />', $text);
+ $text = preg_replace('/{boxFooter}/i', '<hr />', $text);
+ }