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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,6 @@ charset: UTF-8
|
||||
theme: default
|
||||
|
||||
plugins:
|
||||
- Markdown
|
||||
|
||||
pages:
|
||||
flush_cache: false
|
||||
|
@@ -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);
|
@@ -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
|
Reference in New Issue
Block a user