forked from mirrors/org-mode
org-footnote: prevent LaTeX export from catching footnotes in protect environment
* lisp/org-footnote.el (org-footnote-in-valid-context-p): check `org-protected' property before allowing to match a footnote. (org-footnote-at-reference-p): remove an obsolete test. It's now done in the previous function.
This commit is contained in:
parent
8c6c6a4f3d
commit
c3631aae7e
|
@ -171,8 +171,10 @@ extracted will be filled again."
|
||||||
(save-match-data
|
(save-match-data
|
||||||
(not (or (org-in-commented-line)
|
(not (or (org-in-commented-line)
|
||||||
(org-in-indented-comment-line)
|
(org-in-indented-comment-line)
|
||||||
(org-in-verbatim-emphasis)
|
;; Avoid protected environments (LaTeX export)
|
||||||
|
(get-text-property (point) 'org-protected)
|
||||||
;; Avoid literal example.
|
;; Avoid literal example.
|
||||||
|
(org-in-verbatim-emphasis)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(beginning-of-line)
|
(beginning-of-line)
|
||||||
(looking-at "[ \t]*:[ \t]+"))
|
(looking-at "[ \t]*:[ \t]+"))
|
||||||
|
@ -223,8 +225,7 @@ positions, and the definition, when inlined."
|
||||||
;; optional argument of the command. Thus, check
|
;; optional argument of the command. Thus, check
|
||||||
;; the `org-protected' property of that command.
|
;; the `org-protected' property of that command.
|
||||||
(or (not (org-inside-latex-macro-p))
|
(or (not (org-inside-latex-macro-p))
|
||||||
(and (get-text-property (1- beg) 'org-protected)
|
(get-text-property (1- beg) 'org-protected)))
|
||||||
(not (get-text-property beg 'org-protected)))))
|
|
||||||
(list label beg end
|
(list label beg end
|
||||||
;; Definition: ensure this is an inline footnote first.
|
;; Definition: ensure this is an inline footnote first.
|
||||||
(and (or (not label) (match-string 1))
|
(and (or (not label) (match-string 1))
|
||||||
|
|
Loading…
Reference in New Issue