Browse Source

Merge branch 'bugfix'

Nicolas Goaziou 3 năm trước cách đây
mục cha
commit
6ac5e0adc8
2 tập tin đã thay đổi với 9 bổ sung2 xóa
  1. 6 2
      lisp/org-lint.el
  2. 3 0
      testing/lisp/test-org-lint.el

+ 6 - 2
lisp/org-lint.el

@@ -829,8 +829,12 @@ Use \"export %s\" instead"
     reports))
 
 (defun org-lint-undefined-footnote-reference (ast)
-  (let ((definitions (org-element-map ast 'footnote-definition
-		       (lambda (f) (org-element-property :label f)))))
+  (let ((definitions
+          (org-element-map ast '(footnote-definition footnote-reference)
+	    (lambda (f)
+              (and (or (eq 'footnote-definition (org-element-type f))
+                       (eq 'inline (org-element-property :type f)))
+                   (org-element-property :label f))))))
     (org-element-map ast 'footnote-reference
       (lambda (f)
 	(let ((label (org-element-property :label f)))

+ 3 - 0
testing/lisp/test-org-lint.el

@@ -378,6 +378,9 @@ This is not a node property
   (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:1:inline reference] [fn:1]"
+     (org-lint '(undefined-footnote-reference))))
   (should-not
    (org-test-with-temp-text "Text[fn::anonymous reference]"
      (org-lint '(undefined-footnote-reference)))))