From a208aaf6bf5c004eec2c283b84580a003c0e611e Mon Sep 17 00:00:00 2001 From: zcy <290198252@qq.com> Date: Fri, 16 Feb 2024 23:40:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=89=8D=E7=AB=AFdemo?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Controllers/ArticleTree.php | 3 --- App/Controllers/NewUi.php | 10 +++++++--- App/Views/blog/article.html | 15 +++++++++++---- App/Views/blog/index.html | 9 ++++++++- App/Views/blog/template/about.html | 2 +- App/Views/blog/template/visual.html | 16 ++++++++++++++++ 6 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 App/Views/blog/template/visual.html diff --git a/App/Controllers/ArticleTree.php b/App/Controllers/ArticleTree.php index 6f7a011..11721ef 100644 --- a/App/Controllers/ArticleTree.php +++ b/App/Controllers/ArticleTree.php @@ -114,9 +114,6 @@ class ArticleTree extends Controller } } function articleAction(){ - // $baseDir = dirname($vendorDir); - - // var_dump($vendorDir,$baseDir); $redis = new \Redis(); $redis->connect(\App\Config::RedisServer(), 6379); //查看服务是否运行 diff --git a/App/Controllers/NewUi.php b/App/Controllers/NewUi.php index ed04a61..7b78b00 100644 --- a/App/Controllers/NewUi.php +++ b/App/Controllers/NewUi.php @@ -169,8 +169,8 @@ class NewUi extends Controller $doc_all = $docModel->getArticlesTree($doc[0]["id"]); $doc_vers = $docModel->DocVersTime($id); - $markdown = new \ParsedownToC(); - $doc[0]['content'] = $markdown->body($doc[0]['content']); + // $markdown = new \ParsedownToC(); + // $doc[0]['content'] = $markdown->body($doc[0]['content']); $typedocs = $docModel->getAllTypeDocs(); $doccoment = $commentModel->DocComments($id); @@ -178,7 +178,11 @@ class NewUi extends Controller $top5 = $docModel->top5Doc(); $groups = $docModel->getGroups(); $groupstype = $docModel->GetAllGroupType(); - + foreach ($doc as $key => $value) { + $str = str_replace(array("\r", "\n"), array('', '\n'), addslashes($value['content'])); + $doc[$key]['content'] = $str; + } + if (\App\Config::$DEBUG) View::renderTemplate("/blog/article.html", [ diff --git a/App/Views/blog/article.html b/App/Views/blog/article.html index 7e35b64..c2d2d99 100644 --- a/App/Views/blog/article.html +++ b/App/Views/blog/article.html @@ -11,9 +11,7 @@ - - - + +{% block article %} +
+ +
+ +{% endblock %} \ No newline at end of file