forked from mirrors/org-mode
org-footnote: find correct reference when two footnotes are side-by-side
* lisp/org-footnote.el (org-footnote-at-reference-p): first check if point is at the beginning of a footnote. Indeed `org-in-regexp' first checks backwards and might find an incorrect footnote if they are side-by-side.
This commit is contained in:
parent
f0bbfe50aa
commit
bab6c5bf5a
|
@ -161,7 +161,8 @@ If so, return an list containing its label, beginning and ending
|
||||||
positions, and the definition, if local."
|
positions, and the definition, if local."
|
||||||
(when (and (not (or (org-in-commented-line)
|
(when (and (not (or (org-in-commented-line)
|
||||||
(org-in-verbatim-emphasis)))
|
(org-in-verbatim-emphasis)))
|
||||||
(or (org-in-regexp org-footnote-re)
|
(or (looking-at org-footnote-re)
|
||||||
|
(org-in-regexp org-footnote-re)
|
||||||
(save-excursion (re-search-backward org-footnote-re nil t)))
|
(save-excursion (re-search-backward org-footnote-re nil t)))
|
||||||
;; A footnote reference cannot start at bol.
|
;; A footnote reference cannot start at bol.
|
||||||
(/= (match-beginning 0) (point-at-bol)))
|
(/= (match-beginning 0) (point-at-bol)))
|
||||||
|
|
Loading…
Reference in a new issue