From 39e0643c6352ac42dbc3590e0535bf3935b811da Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Sat, 12 Sep 2015 10:36:41 +0300 Subject: [PATCH] =?UTF-8?q?ADD=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5,=20=D0=BA?= =?UTF-8?q?=D0=B0=D0=BA=20=D0=B2=20Ghost=20-=20=D0=BF=D0=B0=D1=80=D0=B0?= =?UTF-8?q?=D0=BB=D0=BB=D0=B5=D0=BB=D1=8C=D0=BD=D0=BE=D0=B5=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=BB=D0=B8=D1=81=D1=82=D1=8B=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5,=20=D0=BF=D0=BE=D0=BA=D0=B0=D0=B7=20=D0=BE=D1=82=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D0=BC=D0=B0=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BC=D0=B0=D1=80=D0=BA-?= =?UTF-8?q?=D0=B4=D0=B0=D1=83=D0=BD=20=D1=82=D0=B5=D0=BA=D1=81=D1=82=D0=B0?= =?UTF-8?q?=20=D1=81=20=D0=BD=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88=D0=BE?= =?UTF-8?q?=D0=B9=20=D0=B7=D0=B0=D0=B4=D0=B5=D1=80=D0=B6=D0=BA=D0=BE=D0=B9?= =?UTF-8?q?=20(300=D0=BC=D1=81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ground/controllers/ArticlesController.php | 17 ++++++++- ground/views/articles/edit.php | 43 +++++++++++++++++++++-- 2 files changed, 56 insertions(+), 4 deletions(-) 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 @@
-
+

Редактирование статьи

@@ -64,8 +64,18 @@
- - + + + + + +
+ + + +
+
+ *текст* **текст** ***текст*** http://ссылка.ру # заголвок1 ## заголовк2 ### заголовк3 [#512|ссылка на точку 512]
@@ -98,3 +108,30 @@
+