add special case for empty paragraphs

This commit is contained in:
2025-09-02 18:25:17 -07:00
parent dc2d9ed906
commit a78e3c8b09

View File

@@ -149,10 +149,14 @@
(inner-iter (list) rst)])
(outer-iter (append acc (list inner-acc)) inner-rst))))
;; the algorithm implemented here does not work for empty
;; paragraphs. thus, they are handled as a special case here.
(if (non-empty-string? paragraph)
;; join each sublist into one string, and display one string per
;; line
(for-each displayln
(map string-join (outer-iter (list) (string-split paragraph)))))
(map string-join (outer-iter (list) (string-split paragraph))))
(newline)))
(define (render-gemtext document)
(for-each (λ (line)