GNU bug report logs - #61306
[PATCH 0/5] Modernize the html engine

Previous Next

Package: skribilo;

Reported by: Arun Isaac <arunisaac <at> systemreboot.net>

Date: Mon, 6 Feb 2023 00:07:02 UTC

Severity: normal

Tags: patch

Done: Arun Isaac <arunisaac <at> systemreboot.net>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 61306 <at> debbugs.gnu.org (full text, mbox):

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: 61306 <at> debbugs.gnu.org
Cc: Arun Isaac <arunisaac <at> systemreboot.net>
Subject: [PATCH 5/5] html: Use for-each instead of explicit loop.
Date: Mon,  6 Feb 2023 00:08:19 +0000
* src/guile/skribilo/engine/html.scm (&html-footnotes): Use for-each
instead of explicit loop.
---
 src/guile/skribilo/engine/html.scm | 41 +++++++++++++++---------------
 1 file 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 ...                                           */
-- 
2.38.1





This bug report was last modified 2 years and 79 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.