summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2013-10-16 13:24:37 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2013-10-16 13:24:37 +0200
commit61e4f1b2c8fa5198c7af1a8c60c20a2255a5e656 (patch)
tree7d299ec223ac4876766dc80317275264bfea54d2
parentfb5003ea6314666a2701e7c5ef689f9370d95209 (diff)
parentb1e7b86fda3d6a61ae1c3f30439567cf3f5a7ec5 (diff)
downloadorg-mode-61e4f1b2c8fa5198c7af1a8c60c20a2255a5e656.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org-element.el5
-rw-r--r--testing/lisp/test-org-element.el8
2 files changed, 10 insertions, 3 deletions
diff --git a/lisp/org-element.el b/lisp/org-element.el
index f57ef1c..3e75365 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -1230,9 +1230,10 @@ CONTENTS is the contents of the element."
(throw 'exit (sort struct 'car-less-than-car))))))
;; Skip blocks (any type) and drawers contents.
(cond
- ((and (looking-at "#\\+BEGIN\\(:[ \t]*$\\|_\\S-\\)+")
+ ((and (looking-at "#\\+BEGIN\\(:\\|_\\S-+\\)")
(re-search-forward
- (format "^[ \t]*#\\+END%s[ \t]*$" (match-string 1))
+ (format "^[ \t]*#\\+END%s[ \t]*$"
+ (match-string-no-properties 1))
limit t)))
((and (looking-at drawers-re)
(re-search-forward "^[ \t]*:END:[ \t]*$" limit t))))
diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el
index 7d36ba5..da9011e 100644
--- a/testing/lisp/test-org-element.el
+++ b/testing/lisp/test-org-element.el
@@ -1127,7 +1127,13 @@ DEADLINE: <2012-03-29 thu.>"
(equal '(("- item"))
(org-test-with-temp-text "- - item"
(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