org-gfm-footnote-section: Cosmetics

This commit is contained in:
Jonas Bernoulli 2023-07-19 02:32:57 +02:00
parent a971997f8f
commit 4f774f13d3

View File

@ -239,31 +239,20 @@ contextual information."
(defun org-gfm-footnote-section (info) (defun org-gfm-footnote-section (info)
"Format the footnote section. "Format the footnote section.
INFO is a plist used as a communication channel." INFO is a plist used as a communication channel."
(let* ((fn-alist (org-export-collect-footnote-definitions info)) (and-let* ((fn-alist (org-export-collect-footnote-definitions info)))
(fn-alist (format
(cl-loop for (n _type raw) in fn-alist collect "## Footnotes\n\n%s\n"
(cons n (org-trim (org-export-data raw info)))))) (mapconcat (pcase-lambda (`(,n ,_type ,def))
(when fn-alist (format
(format "%s %s\n"
"## %s\n%s" (format (plist-get info :html-footnote-format)
"Footnotes" (org-html--anchor
(format (format "fn.%d" n)
"\n%s\n" n
(mapconcat (format " class=\"footnum\" href=\"#fnr.%d\"" n)
(lambda (fn) info))
(let ((n (car fn)) (def (cdr fn))) (org-trim (org-export-data def info))))
(format fn-alist "\n"))))
"%s %s\n"
(format
(plist-get info :html-footnote-format)
(org-html--anchor
(format "fn.%d" n)
n
(format " class=\"footnum\" href=\"#fnr.%d\"" n)
info))
def)))
fn-alist
"\n"))))))
;;;; Template ;;;; Template