org-lint: Fix wrong warning with inline footnotes
* lisp/org-lint.el (org-lint-undefined-footnote-reference): Do not warn when definition is inline. * testing/lisp/test-org-lint.el (test-org-lint/undefined-footnote-reference): Add tests. Reported-by: Eric S Fraga <esflists@gmail.com> <http://lists.gnu.org/archive/html/emacs-orgmode/2017-08/msg00577.html>
This commit is contained in:
parent
2ff3101c0e
commit
c1b9d38c89
|
@ -724,7 +724,7 @@ Use \"export %s\" instead"
|
|||
(org-element-map ast 'footnote-reference
|
||||
(lambda (f)
|
||||
(let ((label (org-element-property :label f)))
|
||||
(and label
|
||||
(and (eq 'standard (org-element-property :type f))
|
||||
(not (member label definitions))
|
||||
(list (org-element-property :begin f)
|
||||
(format "Missing definition for footnote [%s]"
|
||||
|
|
|
@ -304,6 +304,12 @@ This is not a node property
|
|||
(org-lint '(undefined-footnote-reference))))
|
||||
(should-not
|
||||
(org-test-with-temp-text "Text[fn:1]\n[fn:1] Definition"
|
||||
(org-lint '(undefined-footnote-reference))))
|
||||
(should-not
|
||||
(org-test-with-temp-text "Text[fn:1:inline reference]"
|
||||
(org-lint '(undefined-footnote-reference))))
|
||||
(should-not
|
||||
(org-test-with-temp-text "Text[fn::anonymous reference]"
|
||||
(org-lint '(undefined-footnote-reference)))))
|
||||
|
||||
(ert-deftest test-org-lint/unreferenced-footnote-definition ()
|
||||
|
|
Loading…
Reference in New Issue