Create pico_markdown.php

Trying to decouple Markdown from core.
Need a way to replace %base_url%
This commit is contained in:
SimoneS93 2015-06-27 18:16:01 +02:00
parent e942d40187
commit 72edc5a063

29
plugins/pico_markdown.php Normal file
View file

@ -0,0 +1,29 @@
<?php
/**
* Write page content in Markdown
* @author Simone Salerno
* @version 1.0.0
* @license MIT
*/
class pico_markdown {
/**
* Parse Markdown content
* @param array $data
*/
public function get_page_data(&$data) {
$this->parse_content($data['content']);
}
/**
* Parse Markdown content
* @param string $content
*/
public function parse_content(&$content) {
$content = preg_replace('#/\*.+?\*/#s', '', $content); // Remove comments and meta
#$content = str_replace('%base_url%', $this->base_url(), $content);
$content = Michelf\Markdown::defaultTransform($content);
}
}