From 5e4dd19f28de2e64ecb67aae88f3ab42dd535326 Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 30 Dec 2021 22:28:12 +0200 Subject: [PATCH] add url clickable --- src/public/css/template/default/module/feed.css | 10 ++++++++++ src/system/helper/format.php | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/public/css/template/default/module/feed.css b/src/public/css/template/default/module/feed.css index c4a1d50..5f7db25 100644 --- a/src/public/css/template/default/module/feed.css +++ b/src/public/css/template/default/module/feed.css @@ -7,6 +7,16 @@ min-height: 84px; } +.moduleFeed .item a, +.moduleFeed .item a:active, +.moduleFeed .item a:visited { + color: #345b8e; +} + +.moduleFeed .item a:hover { + text-decoration: underline; +} + .moduleFeed .item .avatar { position: absolute; top: 19px; diff --git a/src/system/helper/format.php b/src/system/helper/format.php index abcfeb5..bc673ad 100644 --- a/src/system/helper/format.php +++ b/src/system/helper/format.php @@ -48,6 +48,9 @@ class Format { public static function post(string $text) { - return nl2br($text); + $text = preg_replace("|((https?://)?([\d\w\.-]+\.[\w\.]{2,6})[^\s\]\[\<\>]*/?)|i", "$3", $text); + $text = nl2br($text); + + return $text; } } \ No newline at end of file