From ad57e84ebb7ed1d650e99027f23821f659a4566d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 19 May 2016 06:42:32 -0700 Subject: Get rid of shortening; render URLs. --- aliases.txr | 11 ++--------- util.tl | 8 ++++++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/aliases.txr b/aliases.txr index f667918..67874c7 100644 --- a/aliases.txr +++ b/aliases.txr @@ -14,15 +14,8 @@ (:method get-decoded-memo (alias) (url-decode alias.memo)) (:method get-html-memo (alias) - (let* ((mem alias.(get-decoded-memo)) - (html (html-encode mem))) - (ifa (< (length mem) 60) - html - ` \ - @(html-encode [mem 0..27]) \ \ - [...] \ \ - @(html-encode [mem -27..t])`))))) + (let* ((mem alias.(get-decoded-memo))) + (html-encode-with-http mem))))) @; @(bind selected-alias-keys nil) @; 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 `[link]`))) + pairs)))) -- cgit v1.2.3