mirror of
https://github.com/twisterarmy/cloud-server.git
synced 2025-09-02 17:02:36 +00:00
ignore markdown on string spaces
This commit is contained in:
parent
440fc1da3d
commit
928fe02fa9
@ -48,11 +48,11 @@ class Format {
|
||||
|
||||
public static function post(string $text) {
|
||||
|
||||
$text = preg_replace("|\*(.*?)\*|i", "<b>$1</b>", $text);
|
||||
$text = preg_replace("|\~(.*?)\~|i", "<i>$1</i>", $text);
|
||||
$text = preg_replace("|\_(.*?)\_|i", "<u>$1</u>", $text);
|
||||
$text = preg_replace("|\-(.*?)\-|i", "<s>$1</s>", $text);
|
||||
$text = preg_replace("|\`(.*?)\`|i", "<samp>$1</samp>", $text);
|
||||
$text = preg_replace("|\*([\S]+)\*|i", "<b>$1</b>", $text);
|
||||
$text = preg_replace("|\~([\S]+)\~|i", "<i>$1</i>", $text);
|
||||
$text = preg_replace("|\_([\S]+)\_|i", "<u>$1</u>", $text);
|
||||
$text = preg_replace("|\-([\S]+)\-|i", "<s>$1</s>", $text);
|
||||
$text = preg_replace("|\`([\S]+)\`|i", "<samp>$1</samp>", $text);
|
||||
|
||||
$text = preg_replace("|@([a-zA-Z0-9_]+)|i", "<a href=\"people/$1\">@$1</a>", $text);
|
||||
$text = preg_replace("|((https?://)+([\d\w\.-]+\.[\w\.]{2,6})[^\s\]\[\<\>]*/?)|i", "<a href=\"$1\" target=\"_blank\">$3</a>", $text);
|
||||
|
Loading…
x
Reference in New Issue
Block a user