From e1d6e4678da17784c54f86eb2bf67a61bc385969 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 15 Jun 2024 21:25:29 -0500 Subject: Fix html filters --- lib/html.scm | 63 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/lib/html.scm b/lib/html.scm index 26cdff4..9ed5957 100644 --- a/lib/html.scm +++ b/lib/html.scm @@ -28,37 +28,36 @@ (char->tag "`" "code")) s)) (set-formats! - '((para (line . "~a~%") - (stanza . "

~% ~a

~%")) - (verb (line . "~a~%") - (stanza . "
~a
~%")) - (link (line . "
  • ~a
  • ~%") - (stanza . "~%") - (inline . "~a~%")) - (list (line . "
  • ~a
  • ~%") - (stanza . "~%")) - (quot (line . "~a~%") - (stanza . "
    ~% ~a
    ~%")) - (hdr1 (line . "~a") - (stanza . "

    ~a

    ~%")) - (hdr2 (line . "~a") - (stanza . "

    ~a

    ~%")) - (hdr3 (line . "~a") - (stanza . "

    ~a

    ~%")))) + '((para (line . "~a~%") + (stanza . "

    ~% ~a

    ~%")) + (verb (line . "~a~%") + (stanza . "
    ~a
    ~%")) + (link (line . "
  • ~a
  • ~%") + (stanza . "~%") + (inline . "~a~%")) + (list (line . "
  • ~a
  • ~%") + (stanza . "~%")) + (quot (line . "~a~%") + (stanza . "
    ~% ~a
    ~%")) + (hdr1 (line . "~a") + (stanza . "

    ~a

    ~%")) + (hdr2 (line . "~a") + (stanza . "

    ~a

    ~%")) + (hdr3 (line . "~a") + (stanza . "

    ~a

    ~%")))) (set-filters! - `((verb (line . ,identity) - (stanza . ,join-lines)) - (link (line . ,(lambda (ln) - (cons (car ln) - ((o list - add-inline-markup - escape-entities - string-join) - (cdr ln)))))) - (default - (line . ,(o list - add-inline-markup - escape-entities - string-join)) - (stanza . ,string-join)))) + `((verb (stanza . ,(o ensure-newline (cut string-join <> "\n")))) + (link (line . ,(lambda (ln) + (cons (car ln) + ((o list + add-inline-markup + escape-entities + string-join) + (cdr ln)))))) + (default + (line . ,(o list + add-inline-markup + escape-entities + string-join)) + (stanza . ,string-join)))) -- cgit 1.4.1-21-gabe81