block quotes, arrow quotes, h1-4, ul, ol, li
git-svn-id: file:///home/shish/svn/shimmie2/trunk@654 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
c83ba877d3
commit
a811504a14
@ -15,13 +15,21 @@ class BBCode extends Extension {
|
||||
$text = preg_replace("/\[i\](.*?)\[\/i\]/s", "<i>\\1</i>", $text);
|
||||
$text = preg_replace("/\[u\](.*?)\[\/u\]/s", "<u>\\1</u>", $text);
|
||||
$text = preg_replace("/\[code\](.*?)\[\/code\]/s", "<pre>\\1</pre>", $text);
|
||||
$text = preg_replace("/>>(\d+)/s",
|
||||
"<a href='".make_link("post/view/\\1")."'>>>\\1</a>", $text);
|
||||
$text = preg_replace("/>>(\d+)/s", "<a href='".make_link("post/view/\\1")."'>>>\\1</a>", $text);
|
||||
$text = preg_replace("/>>([^\d].+)/", "<blockquote><small>\\1</small></blockquote>", $text);
|
||||
$text = preg_replace("/\[url=((?:https?|ftp|irc):\/\/.*?)\](.*?)\[\/url\]/s", "<a href='\\1'>\\2</a>", $text);
|
||||
$text = preg_replace("/\[url\]((?:https?|ftp|irc):\/\/.*?)\[\/url\]/s", "<a href='\\1'>\\1</a>", $text);
|
||||
$text = preg_replace("/\[\[(.*?)\]\]/s",
|
||||
"<a href='".make_link("wiki/\\1")."'>\\1</a>", $text);
|
||||
$text = preg_replace("/\[\[(.*?)\]\]/s", "<a href='".make_link("wiki/\\1")."'>\\1</a>", $text);
|
||||
$text = str_replace("\n", "\n<br>", $text);
|
||||
$text = preg_replace("/\[quote\](.*?)\[\/quote\]/s", "<blockquote><small>\\1</small></blockquote>", $text);
|
||||
$text = preg_replace("/\[quote=(.*?)\](.*?)\[\/quote\]/s", "<small><small>Quoting \\1</small></small><blockquote><small>\\2</small></blockquote>", $text);
|
||||
$text = preg_replace("/\[h1\](.*?)\[\/h1\]/s", "<h1>\\1</h1>", $text);
|
||||
$text = preg_replace("/\[h2\](.*?)\[\/h2\]/s", "<h2>\\1</h2>", $text);
|
||||
$text = preg_replace("/\[h3\](.*?)\[\/h3\]/s", "<h3>\\1</h3>", $text);
|
||||
$text = preg_replace("/\[h4\](.*?)\[\/h4\]/s", "<h4>\\1</h4>", $text);
|
||||
$text = preg_replace("/\[ul\](.*?)\[\/ul\]/s", "<ul>\\1</ul>", $text);
|
||||
$text = preg_replace("/\[ol\](.*?)\[\/ol\]/s", "<ol>\\1</ol>", $text);
|
||||
$text = preg_replace("/\[li\](.*?)\[\/li\]/s", "<li>\\1</li>", $text);
|
||||
return $text;
|
||||
}
|
||||
|
||||
@ -35,6 +43,15 @@ class BBCode extends Extension {
|
||||
$text = preg_replace("/\[url=(.*?)\](.*?)\[\/url\]/s", "\\2", $text);
|
||||
$text = preg_replace("/\[url\](.*?)\[\/url\]/s", "\\1", $text);
|
||||
$text = preg_replace("/\[\[(.*?)\]\]/s", "\\1", $text);
|
||||
$text = preg_replace("/\[quote\](.*?)\[\/quote\]/s", "", $text);
|
||||
$text = preg_replace("/\[quote=(.*?)\](.*?)\[\/quote\]/s", "", $text);
|
||||
$text = preg_replace("/\[h1\](.*?)\[\/h1\]/s", "\\1", $text);
|
||||
$text = preg_replace("/\[h2\](.*?)\[\/h2\]/s", "\\1", $text);
|
||||
$text = preg_replace("/\[h3\](.*?)\[\/h3\]/s", "\\1", $text);
|
||||
$text = preg_replace("/\[h4\](.*?)\[\/h4\]/s", "\\1", $text);
|
||||
$text = preg_replace("/\[ul\](.*?)\[\/ul\]/s", "\\1", $text);
|
||||
$text = preg_replace("/\[ol\](.*?)\[\/ol\]/s", "\\1", $text);
|
||||
$text = preg_replace("/\[li\](.*?)\[\/li\]/s", "\\1", $text);
|
||||
return $text;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user