mirror of
https://github.com/twisterarmy/cloud-server.git
synced 2025-09-10 21:02:13 +00:00
add url clickable
This commit is contained in:
parent
2a9e5f25e5
commit
5e4dd19f28
@ -7,6 +7,16 @@
|
|||||||
min-height: 84px;
|
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 {
|
.moduleFeed .item .avatar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 19px;
|
top: 19px;
|
||||||
|
@ -48,6 +48,9 @@ class Format {
|
|||||||
|
|
||||||
public static function post(string $text) {
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user