add url clickable

This commit is contained in:
ghost 2021-12-30 22:28:12 +02:00
parent 2a9e5f25e5
commit 5e4dd19f28
2 changed files with 14 additions and 1 deletions

View File

@ -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;

View File

@ -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", "<a href=\"$1\" target=\"_blank\">$3</a>", $text);
$text = nl2br($text);
return $text;
}
}