瀏覽代碼

Do not add an extraneous blank lines when parsing lists

* lisp/org-exp.el (org-export-mark-list-end,
  org-export-mark-list-properties): don't remove the ending regexp
  when it consists in blank lines.
* lisp/org-list.el (org-list-parse-list): ditto, but remove it
  completely when it isn't made of blank lines (i.e. during export process).
Nicolas Goaziou 14 年之前
父節點
當前提交
ba092ec08d
共有 2 個文件被更改,包括 4 次插入1 次删除
  1. 2 0
      lisp/org-exp.el
  2. 2 1
      lisp/org-list.el

+ 2 - 0
lisp/org-exp.el

@@ -1786,6 +1786,7 @@ These special cookies will later be interpreted by the backend."
 		  (top-ind (org-list-get-ind top struct)))
 	     (goto-char bottom)
 	     (when (and (not (eq org-list-ending-method 'indent))
+			(not (looking-at "[ \t]*$"))
 			(looking-at org-list-end-re))
 	       (replace-match ""))
 	     (unless (bolp) (insert "\n"))
@@ -1844,6 +1845,7 @@ These special properties will later be interpreted by the backend."
 	      (goto-char bottom)
 	      (when (or (looking-at "^ORG-LIST-END-MARKER\n")
 			(and (not (eq org-list-ending-method 'indent))
+			     (not (looking-at "[ \t]*$"))
 			     (looking-at org-list-end-re)))
 		(replace-match ""))
 	      (unless (bolp) (insert "\n"))

+ 2 - 1
lisp/org-list.el

@@ -2897,8 +2897,9 @@ Point is left at list end."
     (when delete
       (delete-region top bottom)
       (when (and (not (eq org-list-ending-method 'indent))
+		 (not (looking-at "[ \t]*$"))
 		 (looking-at org-list-end-re))
-	(replace-match "\n")))
+	(replace-match "")))
     out))
 
 (defun org-list-make-subtree ()