summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2020-04-23 00:26:14 +0200
committerRicardo Wurmus <rekado@elephly.net>2020-04-23 00:26:14 +0200
commitda3572b906ec480fef3e29e0fa8d8de49b751624 (patch)
tree51c7d50f3c3d80fe9b4999689fe8ce43997d321d
parent9dfb0acb540ad56642932e592870c2aeca1754b1 (diff)
utils: Simplify prettify.
-rw-r--r--mumi/web/view/utils.scm8
1 files changed, 2 insertions, 6 deletions
diff --git a/mumi/web/view/utils.scm b/mumi/web/view/utils.scm
index 9e9e11f..782f737 100644
--- a/mumi/web/view/utils.scm
+++ b/mumi/web/view/utils.scm
@@ -78,17 +78,13 @@
((#:result res #:context context)
(receive (processed new-context)
(process line context)
- `(#:result ,(append (list processed '(br)) res)
+ `(#:result ,(cons* '(br) processed res)
#:context ,(if new-context
(cons new-context context)
context))))))
'(#:result () #:context ())
(string-split text #\newline))))
- ;; Drop the first line break, because it's for an eof
- ;; read.
- (match (reverse (cadr (find-tail (cut eq? #:result <>) res)))
- ((_ . rest) rest)
- (() '()))))
+ (reverse (and=> (memq #:result res) cadr))))
(define colors
(circular-list "#8dd3c7" "#bebada" "#fb8072"