summaryrefslogtreecommitdiffstats
path: root/util.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-05-19 06:42:32 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-05-19 06:42:32 -0700
commitad57e84ebb7ed1d650e99027f23821f659a4566d (patch)
treeee083d11e5384571a9da420d09b9edc447de9746 /util.tl
parentd8570d05b9f554b3e9703994bcd4f3c4534d613e (diff)
downloadtamarind-ad57e84ebb7ed1d650e99027f23821f659a4566d.tar.gz
tamarind-ad57e84ebb7ed1d650e99027f23821f659a4566d.tar.bz2
tamarind-ad57e84ebb7ed1d650e99027f23821f659a4566d.zip
Get rid of shortening; render URLs.
Diffstat (limited to 'util.tl')
-rw-r--r--util.tl8
1 files changed, 8 insertions, 0 deletions
diff --git a/util.tl b/util.tl
index 71fc985..e987423 100644
--- a/util.tl
+++ b/util.tl
@@ -21,3 +21,11 @@
(defun move-tail (items keys)
(move-impl items keys (length items)))
+
+(defun html-encode-with-http (str)
+ (let* ((pairs (tuples 2 (tok-str str #/https?:\/\/\S+/ t))))
+ (cat-str
+ (mappend (tb ((text : link))
+ (list (html-encode text)
+ (if link `<sup>[<a href="@link">link</a>]</sup>`)))
+ pairs))))