summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob L. Kreuze <jakob.kreuze@us.af.mil>2022-11-11 20:55:22 -0500
committerJakob L. Kreuze <zerodaysfordays@sdf.org>2022-11-15 18:58:09 -0500
commita00a385ae330d750b0878361523101ab964db42b (patch)
tree2b7f177829d2a441b9823d76ddd295b42d82a6a0
parent5074f14e00f00fb0343fadcf7b2ec1c33c8efaaf (diff)
[dynamic] Add commonmark parsing for comments
-rw-r--r--haunt/jakob/utils/comments.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/haunt/jakob/utils/comments.scm b/haunt/jakob/utils/comments.scm
index 65befca..7cb4768 100644
--- a/haunt/jakob/utils/comments.scm
+++ b/haunt/jakob/utils/comments.scm
@@ -15,6 +15,7 @@
;;; <http://www.gnu.org/licenses/>.
(define-module (jakob utils comments)
+ #:use-module (commonmark)
;; #:use-module (dynamic capabilities comments)
#:use-module (dynamic util)
#:use-module (gcrypt base16)
@@ -79,7 +80,8 @@
"(" ,(strip author-url) ")"))
`()))
(div (@ (class "e-content p-name comment-content"))
- ,content-text)
+ ,@(chain content-text
+ (safe-markdown->sxml _)))
(div (@ (class "metaline"))
(a (@ (class "u-url")
(href ,author-url))
@@ -91,7 +93,7 @@
(ul (@ (class "comment-reactions"))
,@(map (match-lambda
((emote . count)
- `(li ,(format "~a (~a)" emote count))))
+ `(li ,(format #f "~a (~a)" emote count))))
content-reactions)))))
(define (render-comment-view response)