summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2023-01-28 12:33:57 +0000
committerArun Isaac2023-02-06 00:04:00 +0000
commite902d4703126ddf5603210192d47c37e3b859f13 (patch)
treeecadf6cae7b520c3724823bcf82316a0e898dfd2
parentcb41281bc88790605383be498bf5e10d360a043e (diff)
downloadskribilo-e902d4703126ddf5603210192d47c37e3b859f13.tar.gz
skribilo-e902d4703126ddf5603210192d47c37e3b859f13.tar.lz
skribilo-e902d4703126ddf5603210192d47c37e3b859f13.zip
html: Use for-each instead of explicit loop.
* src/guile/skribilo/engine/html.scm (&html-footnotes): Use for-each instead of explicit loop.
-rw-r--r--src/guile/skribilo/engine/html.scm41
1 files changed, 20 insertions, 21 deletions
diff --git a/src/guile/skribilo/engine/html.scm b/src/guile/skribilo/engine/html.scm
index e9293e6..da40475 100644
--- a/src/guile/skribilo/engine/html.scm
+++ b/src/guile/skribilo/engine/html.scm
@@ -939,27 +939,26 @@
(display "<div class=\"skribilo-footnote\">")
(display "<hr width='20%' size='2' align='left'>\n"))))
:action (lambda (n e)
- (let ((footnotes (markup-body n)))
- (when (pair? footnotes)
- (let loop ((fns footnotes))
- (if (pair? fns)
- (let ((fn (car fns)))
- (display "\n<div class=\"footnote\">")
-
- ;; Note: the <a> tags must not be nested.
- (format #t "<a name=\"footnote-~a\"></a>"
- (string-canonicalize
- (container-ident fn)))
- (format #t "<a href=\"#footnote-site-~a\">"
- (string-canonicalize
- (container-ident fn)))
- (format #t "<sup><small>~a</small></sup></a>"
- (markup-option fn :label))
- (output (markup-body fn) e)
-
- (display "\n</div>\n")
- (loop (cdr fns)))))
- (display "</div>")))))
+ (let ((footnotes (markup-body n)))
+ (for-each (lambda (fn)
+ (display "\n<div class=\"footnote\">")
+
+ ;; Note: the <a> tags must not be nested.
+
+ (format #t "<a name=\"footnote-~a\"></a>"
+ (string-canonicalize
+ (container-ident fn)))
+ (format #t "<a href=\"#footnote-site-~a\">"
+ (string-canonicalize
+ (container-ident fn)))
+ (format #t "<sup><small>~a</small></sup></a>"
+ (markup-option fn :label))
+ (output (markup-body fn) e)
+
+ (display "\n</div>\n"))
+ footnotes)
+ (when (pair? footnotes)
+ (display "</div>")))))
;*---------------------------------------------------------------------*/
;* html-title-authors ... */