20 lines
545 B
PHP
20 lines
545 B
PHP
<?php
|
|
|
|
class ParsedownHelper extends \Prefab {
|
|
|
|
static public function render($args) {
|
|
$content = $args[0];
|
|
$content_token = \Template::instance()->token($content);
|
|
|
|
return '
|
|
<parsedown_rendered class="content">
|
|
<?php echo \ParsedownHelper::instance()->build('.$content_token.'); ?>
|
|
</parsedown_rendered>';
|
|
}
|
|
|
|
function build($content){
|
|
return Parsedown::instance()->text($content);
|
|
}
|
|
}
|
|
|
|
\Template::instance()->extend('parsedown', 'ParsedownHelper::render'); |