瀏覽代碼

org-element: Fix item parsing with an empty first line and a child below

* contrib/lisp/org-element.el (org-element-item-parser): If item's
  first line is empty, ensure contents start at a beginning of line so
  that child can be correctly parsed.
Nicolas Goaziou 13 年之前
父節點
當前提交
a623767a90
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      contrib/lisp/org-element.el

+ 5 - 3
contrib/lisp/org-element.el

@@ -588,9 +588,11 @@ Assume point is at the beginning of the item."
 	   (contents-begin (progn (looking-at org-list-full-item-re)
 	   (contents-begin (progn (looking-at org-list-full-item-re)
 				  (goto-char (match-end 0))
 				  (goto-char (match-end 0))
 				  (org-skip-whitespace)
 				  (org-skip-whitespace)
-				  (if (>= (point) end)
-				      (point-at-bol)
-				    (point))))
+				  ;; If first line isn't empty,
+				  ;; contents really start at the text
+				  ;; after item's meta-data.
+				  (if (= (point-at-bol) begin) (point)
+				    (point-at-bol))))
 	   (hidden (progn (forward-line)
 	   (hidden (progn (forward-line)
 			  (and (not (= (point) end))
 			  (and (not (= (point) end))
 			       (org-truely-invisible-p))))
 			       (org-truely-invisible-p))))