From c30f5e0472f2463f475e6e4d4cf80341ab1e0e62 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 18 Jun 2024 12:42:48 -0500 Subject: Fix verbatim processing fully No more special-casing on the surface of the code; that is, the filter expects a list of strings and outputs a single string, etc. --- lib/emit.scm | 9 +++++---- lib/html.scm | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/emit.scm b/lib/emit.scm index 68912cf..6c0479c 100644 --- a/lib/emit.scm +++ b/lib/emit.scm @@ -84,7 +84,7 @@ (printf (get-format 'verb 'stanza) ((get-filter 'verb 'stanza) t))) (let ((el (car stanza)) - (text (string-join (apply append (cdr stanza)) "\n"))) + (text (apply append (cdr stanza)))) (with-output-to-string (lambda () (cond @@ -98,12 +98,13 @@ (process command (cdr cmdline) (cons `("JIMMY_OUTPUT" . ,(->string (output-type))) (get-environment-variables))) - (display (ensure-newline text) out) + (display ((o ensure-newline (cut string-join <> "\n")) text) + out) (close-output-port out) (display (read-string #f in)) (newline)) - (emit-verbatim t)))) - (else (emit-verbatim t))))))) + (emit-verbatim text)))) + (else (emit-verbatim text))))))) ;;; Utilities diff --git a/lib/html.scm b/lib/html.scm index 6c16dd0..6780aea 100644 --- a/lib/html.scm +++ b/lib/html.scm @@ -48,7 +48,9 @@ (stanza . "

~a

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