added [align=(left|center|right)] BBcode which aligns text naturally.

This commit is contained in:
NaGeL 2012-01-17 22:45:24 +01:00
parent 46776bf853
commit 3c6217fa4c

View file

@ -63,6 +63,7 @@ class BBCode extends FormatterExtension {
$text = preg_replace("/\[li\](.*?)\[\/li\]/s", "<li>\\1</li>", $text);
$text = preg_replace("#\[\*\]#s", "<li>", $text);
$text = preg_replace("#<br><(li|ul|ol|/ul|/ol)>#s", "<\\1>", $text);
$text = preg_replace("#\[align=(left|center|right)\](.*?)\[\/align\]#s", "<div style='text-align:\\1;'>\\2</div>", $text);
$text = $this->filter_spoiler($text);
$text = $this->insert_code($text);
return $text;