add special case for empty paragraphs
This commit is contained in:
@@ -149,10 +149,14 @@
|
|||||||
(inner-iter (list) rst)])
|
(inner-iter (list) rst)])
|
||||||
(outer-iter (append acc (list inner-acc)) inner-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
|
;; join each sublist into one string, and display one string per
|
||||||
;; line
|
;; line
|
||||||
(for-each displayln
|
(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)
|
(define (render-gemtext document)
|
||||||
(for-each (λ (line)
|
(for-each (λ (line)
|
||||||
|
Reference in New Issue
Block a user