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