diff --git a/ground/controllers/ArticlesController.php b/ground/controllers/ArticlesController.php index 7cf0f0a..31b8a7f 100644 --- a/ground/controllers/ArticlesController.php +++ b/ground/controllers/ArticlesController.php @@ -76,7 +76,7 @@ class ArticlesController extends Controller $title = strip_tags($_POST['title']); $text = str_replace(array('<','>'), array('<','>'), $_POST['text']); - $html = strip_tags($_POST['text']); + $html = strip_tags($_POST['text']); $html = str_replace(array('<','>',"'"), array('<','>','′'), $html); $html = Markdown::processing($html); $html = nl2br($html); @@ -103,4 +103,19 @@ class ArticlesController extends Controller App::redirect('/articles'); } + static function actionMarkdown() + { + if (isset($_POST['text']) ){ + $html = strip_tags($_POST['text']); + $html = str_replace(array('<','>',"'"), array('<','>','′'), $html); + $html = Markdown::processing($html); + $html = nl2br($html); + $html = Helper::replaceLinks($html, 'html'); + $html = Helper::replaceImgs($html, 'html'); + + print $html; + } + + die; + } } diff --git a/ground/views/articles/edit.php b/ground/views/articles/edit.php index 05a483d..8e283a4 100644 --- a/ground/views/articles/edit.php +++ b/ground/views/articles/edit.php @@ -47,7 +47,7 @@
-| + + + | ++ + | +