浏览代码

Version 1.2.0 Introducing editor (markdown parsing for editor fixed)

Sebastian 7 年之前
父节点
当前提交
0df0bd5a8e
共有 3 个文件被更改,包括 6 次插入3 次删除
  1. 1 1
      cache/lastCache.txt
  2. 1 1
      content/index.md
  3. 4 1
      system/Controllers/ContentController.php

+ 1 - 1
cache/lastCache.txt

@@ -1 +1 @@
-1529947976
+1530040430

+ 1 - 1
content/index.md

@@ -1,3 +1,3 @@
 # Typemill
 # Typemill
 
 
-TYPEMILL is a small flat file cms designed for **writers**. It creates websites based on markdown files and is a perfect solution for text-works like studies, manuals or documentations. TYPEMILL is simple, lightweight and open source. Just download and start.
+TYPEMILL is a small flat file cms designed for **writers**. It creates websites based on markdown files and is a perfect solution for text-works like studies, manuals or documentations. TYPEMILL is simple, lightweight and open source. Just download and start. 

+ 4 - 1
system/Controllers/ContentController.php

@@ -102,9 +102,12 @@ class ContentController extends Controller
 		$title = false;
 		$title = false;
 		$content = $contentMD;
 		$content = $contentMD;
 		
 		
+        $content = str_replace(array("\r\n", "\r"), "\n", $content);
+        $content = trim($content, "\n");		
+		
 		if($contentMD[0] == '#')
 		if($contentMD[0] == '#')
 		{
 		{
-			$contentParts = explode("\r\n", $contentMD, 2);
+			$contentParts = explode("\n", $contentMD, 2);
 			$title = trim($contentParts[0],  "# \t\n\r\0\x0B");
 			$title = trim($contentParts[0],  "# \t\n\r\0\x0B");
 			$content = trim($contentParts[1]);
 			$content = trim($contentParts[1]);
 		}
 		}