mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 20:37:51 +00:00
org-element: Fix block parsing in lists
* lisp/org-element.el (org-element--list-struct): Fix block parsing in lists. * testing/lisp/test-org-element.el: Add test. Reported-by: Omid <omidlink@gmail.com>
This commit is contained in:
parent
c1ea2c3df9
commit
b1e7b86fda
|
@ -1230,9 +1230,10 @@ CONTENTS is the contents of the element."
|
||||||
(throw 'exit (sort struct 'car-less-than-car))))))
|
(throw 'exit (sort struct 'car-less-than-car))))))
|
||||||
;; Skip blocks (any type) and drawers contents.
|
;; Skip blocks (any type) and drawers contents.
|
||||||
(cond
|
(cond
|
||||||
((and (looking-at "#\\+BEGIN\\(:[ \t]*$\\|_\\S-\\)+")
|
((and (looking-at "#\\+BEGIN\\(:\\|_\\S-+\\)")
|
||||||
(re-search-forward
|
(re-search-forward
|
||||||
(format "^[ \t]*#\\+END%s[ \t]*$" (match-string 1))
|
(format "^[ \t]*#\\+END%s[ \t]*$"
|
||||||
|
(match-string-no-properties 1))
|
||||||
limit t)))
|
limit t)))
|
||||||
((and (looking-at drawers-re)
|
((and (looking-at drawers-re)
|
||||||
(re-search-forward "^[ \t]*:END:[ \t]*$" limit t))))
|
(re-search-forward "^[ \t]*:END:[ \t]*$" limit t))))
|
||||||
|
|
|
@ -1127,7 +1127,13 @@ DEADLINE: <2012-03-29 thu.>"
|
||||||
(equal '(("- item"))
|
(equal '(("- item"))
|
||||||
(org-test-with-temp-text "- - item"
|
(org-test-with-temp-text "- - item"
|
||||||
(org-element-map
|
(org-element-map
|
||||||
(org-element-parse-buffer) 'paragraph 'org-element-contents)))))
|
(org-element-parse-buffer) 'paragraph 'org-element-contents))))
|
||||||
|
;; Block in an item: ignore indentation within the block.
|
||||||
|
(should
|
||||||
|
(org-test-with-temp-text "- item\n #+begin_src emacs-lisp\n(+ 1 1)\n #+end_src"
|
||||||
|
(forward-char)
|
||||||
|
(goto-char (org-element-property :end (org-element-at-point)))
|
||||||
|
(eobp))))
|
||||||
|
|
||||||
|
|
||||||
;;;; Keyword
|
;;;; Keyword
|
||||||
|
|
Loading…
Reference in a new issue