Browse Source

修复一个解析页面markdown内容的bug

star7th 10 years ago
parent
commit
2fa038fb91
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Application/Home/Controller/PageController.class.php

+ 1 - 1
Application/Home/Controller/PageController.class.php

@@ -9,7 +9,7 @@ class PageController extends BaseController {
         $page_id = I("page_id");
         $page = D("Page")->where(" page_id = '$page_id' ")->find();
         $Parsedown = new \Parsedown();
-        $page['page_content'] = htmlspecialchars_decode($Parsedown->text($page['page_content']));//重新转义回来。因为Parsedown会把代码块里的代码也解析称html实体
+        $page['page_content'] = $Parsedown->text(htmlspecialchars_decode($page['page_content']));
         $this->assign("page" , $page);
         $this->display();
     }