mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-22 23:18:44 +00:00
Merge branch 'maint'
This commit is contained in:
commit
087e51a5d3
|
@ -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 "]")
|
||||
(contents-begin (progn
|
||||
(search-forward "]")
|
||||
(skip-chars-forward " \r\t\n" ending)
|
||||
(and (/= (point) ending) (point))))
|
||||
(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)
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue