diff options
| author | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2024-09-02 18:27:48 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze <zerodaysfordays@sdf.org> | 2024-09-02 18:27:48 -0400 |
| commit | 9eb2229485e7ca30a11c04eada718dcad87b7181 (patch) | |
| tree | 4038297fbc5f433a42a6311f27701fc4c95e5b20 /jakob/utils/comments.scm | |
| parent | cb8c10825ba73153704f214be84b16494dab8d4b (diff) | |
[static] Rewrite commenter URL with protocol
Diffstat (limited to 'jakob/utils/comments.scm')
| -rw-r--r-- | jakob/utils/comments.scm | 9 |
1 files 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") |