Browse Source

add url clickable

main
ghost 3 years ago
parent
commit
5e4dd19f28
  1. 10
      src/public/css/template/default/module/feed.css
  2. 5
      src/system/helper/format.php

10
src/public/css/template/default/module/feed.css

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

5
src/system/helper/format.php

@ -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…
Cancel
Save