Browse Source

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 years ago
parent
commit
a623767a90
1 changed files with 5 additions and 3 deletions
  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)
 				  (goto-char (match-end 0))
 				  (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)
 			  (and (not (= (point) end))
 			       (org-truely-invisible-p))))