Browse Source

Merge branch 'maint'

Conflicts:
	lisp/org-element.el
Nicolas Goaziou 12 years ago
parent
commit
442b2ad15d
2 changed files with 16 additions and 5 deletions
  1. 7 4
      lisp/org-element.el
  2. 9 1
      testing/lisp/test-org-element.el

+ 7 - 4
lisp/org-element.el

@@ -4149,7 +4149,8 @@ Elements are accumulated into ACC."
 	     (plain-list 'item)
 	     (property-drawer 'node-property)
 	     (table 'table-row))
-	   (org-element-property :structure element)
+	   (and (memq type '(item plain-list))
+		(org-element-property :structure element))
 	   granularity visible-only element))
 	 ;; ELEMENT has contents.  Parse objects inside, if
 	 ;; GRANULARITY allows it.
@@ -4591,9 +4592,11 @@ first element of current section."
 		   (plain-list
 		    (setq special-flag 'item
 			  struct (org-element-property :structure element)))
-		   (property-drawer (setq special-flag 'node-property))
-		   (table (setq special-flag 'table-row))
-		   (otherwise (setq special-flag nil)))
+		   (item (setq special-flag nil))
+		   (property-drawer
+		    (setq special-flag 'node-property struct nil))
+		   (table (setq special-flag 'table-row struct nil))
+		   (otherwise (setq special-flag nil struct nil)))
 		 (setq end cend)
 		 (goto-char cbeg)))))))))))
 

+ 9 - 1
testing/lisp/test-org-element.el

@@ -2635,7 +2635,15 @@ Paragraph \\alpha."
    (equal '(paragraph center-block)
 	  (org-test-with-temp-text "#+BEGIN_CENTER\nA\n#+END_CENTER\nZ"
 	    (progn (search-forward "Z")
-		   (mapcar 'org-element-type (org-element-at-point t)))))))
+		   (mapcar 'org-element-type (org-element-at-point t))))))
+  ;; Parse a list within a block itself contained in a list.
+  (should
+   (eq 'plain-list
+       (org-test-with-temp-text
+	   "- outer\n  #+begin_center\n  - inner\n  #+end_center"
+	 (search-forward "inner")
+	 (beginning-of-line)
+	 (org-element-type (org-element-at-point))))))
 
 (ert-deftest test-org-element/context ()
   "Test `org-element-context' specifications."