瀏覽代碼

- fixed list

Laurent Bedubourg 18 年之前
父節點
當前提交
206ec26bcc
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      std/mtwin/text/Text2Xhtml.hx

+ 3 - 2
std/mtwin/text/Text2Xhtml.hx

@@ -150,9 +150,10 @@ class Text2Xhtml {
 		str = StringTools.replace(str, "\r\n", "\n");
 		str = StringTools.replace(str, "\r", "\n");
 		str = StringTools.htmlEscape(str);
-		while (!StringTools.endsWith(str, "\n\n")){
+		while (!StringTools.endsWith(str, "\n\n"))
 			str += "\n";
-		}			
+		while (!StringTools.startsWith(str, "\n\n"))
+			str = "\n"+str;
 
 		var helper = new StringHelper(str);
 		var extractedPre = helper.extract("pre", pre, "<pre>$1</pre>");