From 9eb2229485e7ca30a11c04eada718dcad87b7181 Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Mon, 2 Sep 2024 18:27:48 -0400 Subject: [static] Rewrite commenter URL with protocol --- jakob/utils/comments.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jakob/utils/comments.scm b/jakob/utils/comments.scm index 966d2dc..2fae64d 100644 --- a/jakob/utils/comments.scm +++ b/jakob/utils/comments.scm @@ -93,12 +93,15 @@ (safe-markdown->sxml (internal-comment-comment comment)))) (define (comment-url comment) - (define text + (define url ((if (webmention? comment) webmention-url internal-comment-url) comment)) - (elide-string text 32)) + (if (not (or (string-prefix? "http://" url) + (string-prefix? "https://" url))) + (format #f "http://~a" url) + url)) (define (comment-publish-time comment) ((if (webmention? comment) webmention-publish-time @@ -134,7 +137,7 @@ The I2P logo belongs to The I2P Project, and is licensed under the CC BY 4.0") `(" • " (a (@ (class "author-url") (href ,(comment-url comment))) - "(" ,(strip (comment-url comment)) ")")) + "(" ,(elide-string (strip (comment-url comment)) 32) ")")) `()) " • " (time (@ (class "dt-published") -- cgit v1.3