0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-07-16 03:46:27 +00:00

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))
(match-beginning 0)
(point))))
(contents-begin (progn (search-forward "]")
(skip-chars-forward " \r\t\n" ending)
(and (/= (point) ending) (point))))
(contents-begin (progn
(search-forward "]")
(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))
(end (progn (goto-char ending)
(skip-chars-forward " \r\t\n" limit)

View file

@ -760,21 +760,26 @@ Some other text
"Test `footnote-definition' parser."
(should
(org-test-with-temp-text "[fn:1] Definition"
(org-element-map
(org-element-parse-buffer) 'footnote-definition 'identity nil t)))
(org-element-map (org-element-parse-buffer) 'footnote-definition
'identity nil t)))
;; Footnote with more contents
(should
(= 29
(org-element-property
:end
(org-test-with-temp-text "[fn:1] Definition\n\n| a | b |"
(org-element-map
(org-element-parse-buffer)
'footnote-definition 'identity nil t)))))
(org-element-map (org-element-parse-buffer) 'footnote-definition
'identity nil t)))))
;; Footnote starting with special syntax.
(should-not
(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.