1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-04 12:17:42 +02:00

#431 Markdown as default parser

This commit is contained in:
Awilum
2018-03-06 13:42:59 +03:00
parent 315c517698
commit 2ac21485ab
4 changed files with 3 additions and 41 deletions

View File

@@ -56,10 +56,10 @@ class Page
}
if (is_array($page_content)) {
$page['summary'] = $page['summary'];
$page['content'] = $page['content'];
$page['summary'] = $this->monstra['markdown']->text($page['summary']);
$page['content'] = $this->monstra['markdown']->text($page['content']);
} else {
$page['content'] = $page_content;
$page['content'] = $this->monstra['markdown']->text($page_content);
}
}

View File

@@ -14,7 +14,6 @@ charset: UTF-8
theme: default
plugins:
- Markdown
pages:
flush_cache: false

View File

@@ -1,24 +0,0 @@
<?php
namespace Monstra;
class Markdown extends Plugin
{
/**
* @var Monstra
*/
protected $monstra;
/**
* Construct
*/
public function __construct(Monstra $c)
{
$this->monstra = $c;
$this->monstra['filters']->addListener('content', function($content) {
return $this->monstra['markdown']->text($content);
});
}
}
new Markdown($monstra);

View File

@@ -1,13 +0,0 @@
name: Markdown
version: 1.0.0
description: "Markdown parser plugin for Monstra"
author:
name: Sergey Romanenko
email: awilum@msn.com
url: http://monstra.org
homepage: http://monstra.org
bugs: http://monstra.org
license: MIT
# Plugin settings
enabled: true