bbcode: support [url] tags
This commit is contained in:
parent
b10e5696e2
commit
378dbec981
@ -133,7 +133,8 @@ function text2html($sz) {
|
||||
$base = hesc($sz);
|
||||
|
||||
$base = preg_replace('~^=+(.+)=+~m', '<strong>\\1</strong>', $base);
|
||||
$base = preg_replace('~(https?://[^ \\r\\n\\t]+)~i', '<a href="\\1">\\1</a>', $base);
|
||||
$base = preg_replace('~\\[url=([^\\]]+?)\\](.+?)\\[/url\\]~m', '<a href="\\1">\\2</a>', $base);
|
||||
$base = preg_replace('~([^="])(https?://[^ \\r\\n\\t]+)~i', '\\1<a href="\\2">\\2</a>', $base);
|
||||
$base = preg_replace('~\\[b\\](.+?)\\[/b\\]~m', '<strong>\\1</strong>', $base);
|
||||
$base = preg_replace('~\\[i\\](.+?)\\[/i\\]~m', '<i>\\1</i>', $base);
|
||||
$base = preg_replace('~\\[spoiler\\](.+?)\\[/spoiler\\]~m', '<span class="spoiler">\\1</span>', $base);
|
||||
|
Reference in New Issue
Block a user