Browse Source

make mentions clickable

main
ghost 3 years ago
parent
commit
c1c44db931
  1. 1
      src/system/helper/format.php

1
src/system/helper/format.php

@ -48,6 +48,7 @@ class Format { @@ -48,6 +48,7 @@ class Format {
public static function post(string $text) {
$text = preg_replace("|@([a-zA-Z0-9_]+)|i", "<a href=\"follow/$1\">@$1</a>", $text);
$text = preg_replace("|((https?://)?([\d\w\.-]+\.[\w\.]{2,6})[^\s\]\[\<\>]*/?)|i", "<a href=\"$1\" target=\"_blank\">$3</a>", $text);
$text = nl2br($text);

Loading…
Cancel
Save