Merge branch 'maint'

This commit is contained in:
Nicolas Goaziou 2013-09-11 17:13:46 +02:00
commit 087e51a5d3
2 changed files with 17 additions and 9 deletions

View File

@ -683,9 +683,12 @@ Assume point is at the beginning of the footnote definition."
"^\\([ \t]*\n\\)\\{2,\\}") limit 'move)) "^\\([ \t]*\n\\)\\{2,\\}") limit 'move))
(match-beginning 0) (match-beginning 0)
(point)))) (point))))
(contents-begin (progn (search-forward "]") (contents-begin (progn
(skip-chars-forward " \r\t\n" ending) (search-forward "]")
(and (/= (point) ending) (point)))) (skip-chars-forward " \r\t\n" ending)
(cond ((= (point) ending) nil)
((= (line-beginning-position) begin) (point))
(t (line-beginning-position)))))
(contents-end (and contents-begin ending)) (contents-end (and contents-begin ending))
(end (progn (goto-char ending) (end (progn (goto-char ending)
(skip-chars-forward " \r\t\n" limit) (skip-chars-forward " \r\t\n" limit)

View File

@ -760,21 +760,26 @@ Some other text
"Test `footnote-definition' parser." "Test `footnote-definition' parser."
(should (should
(org-test-with-temp-text "[fn:1] Definition" (org-test-with-temp-text "[fn:1] Definition"
(org-element-map (org-element-map (org-element-parse-buffer) 'footnote-definition
(org-element-parse-buffer) 'footnote-definition 'identity nil t))) 'identity nil t)))
;; Footnote with more contents ;; Footnote with more contents
(should (should
(= 29 (= 29
(org-element-property (org-element-property
:end :end
(org-test-with-temp-text "[fn:1] Definition\n\n| a | b |" (org-test-with-temp-text "[fn:1] Definition\n\n| a | b |"
(org-element-map (org-element-map (org-element-parse-buffer) 'footnote-definition
(org-element-parse-buffer) 'identity nil t)))))
'footnote-definition 'identity nil t)))))
;; Footnote starting with special syntax. ;; Footnote starting with special syntax.
(should-not (should-not
(org-test-with-temp-text "[fn:1] - no item" (org-test-with-temp-text "[fn:1] - no item"
(org-element-map (org-element-parse-buffer) 'item 'identity)))) (org-element-map (org-element-parse-buffer) 'item 'identity)))
;; Correctly handle footnote starting with an empty line.
(should
(= 9
(org-test-with-temp-text "[fn:1]\n\n Body"
(org-element-property :contents-begin
(org-element-at-point))))))
;;;; Footnotes Reference. ;;;; Footnotes Reference.