Function: org-html-footnote-reference

org-html-footnote-reference is a byte-compiled function defined in ox-html.el.gz.

Signature

(org-html-footnote-reference FOOTNOTE-REFERENCE CONTENTS INFO)

Documentation

Transcode a FOOTNOTE-REFERENCE element from Org to HTML.

CONTENTS is nil. INFO is a plist holding contextual information.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox-html.el.gz
;;;; Footnote Reference

(defun org-html-footnote-reference (footnote-reference _contents info)
  "Transcode a FOOTNOTE-REFERENCE element from Org to HTML.
CONTENTS is nil.  INFO is a plist holding contextual information."
  (concat
   ;; Insert separator between two footnotes in a row.
   (let ((prev (org-export-get-previous-element footnote-reference info)))
     (when (org-element-type-p prev 'footnote-reference)
       (plist-get info :html-footnote-separator)))
   (let* ((n (org-export-get-footnote-number footnote-reference info))
          (label (org-element-property :label footnote-reference))
          ;; Do not assign number labels as they appear in Org mode -
          ;; the footnotes are re-numbered by
          ;; `org-export-get-footnote-number'.  If the label is not a
          ;; number, keep it.
          (label (if (and (stringp label)
                          (equal label (number-to-string (string-to-number label))))
                          nil
                   label))
	  (id (format "fnr.%s%s"
		      (or label n)
		      (if (org-export-footnote-first-reference-p
			   footnote-reference info)
			  ""
                        (let ((label (org-element-property :label footnote-reference)))
                          (format
                           ".%d"
                           (org-export-get-ordinal
                            footnote-reference info '(footnote-reference)
                            `(lambda (ref _)
                               (if ,label
                                   (equal (org-element-property :label ref) ,label)
                                 (not (org-element-property :label ref)))))))))))
     (format
      (plist-get info :html-footnote-format)
      (org-html--anchor
       id n (format " class=\"footref\" href=\"#fn.%s\" role=\"doc-backlink\"" (or label n)) info)))))