35 lines
946 B
PHP
35 lines
946 B
PHP
<?php
|
|
|
|
class ParsedownHelper extends \Prefab {
|
|
|
|
static public function render($args) {
|
|
|
|
if(isset($args['@attrib']) && $args['@attrib']['inline'] === 'true'){
|
|
|
|
$return = \Parsedown::instance()->text($args[0]);
|
|
|
|
return '<!-- tableextension -->
|
|
<div class="content">
|
|
<parsedown_rendered>'.$return.'</parsedown_rendered>
|
|
</div>
|
|
';
|
|
|
|
}
|
|
|
|
// return '<pre>'.print_r($args,1).'</pre>';
|
|
|
|
$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 \ParsedownTableExtension::instance()->text($content);
|
|
}
|
|
}
|
|
|
|
\Template::instance()->extend('parsedown', 'ParsedownHelper::render'); |