BBCode [size=50] --> font-size: 50px (with the unit px).

This [size=number] without unit is kind of a standard.
It was being rendered like "font-size: 50" and that's not valid CSS style.
This commit is contained in:
Abinoam P. Marques Jr 2012-02-12 14:59:07 -08:00
parent 92a585ed23
commit 74b529bda2

View File

@ -138,6 +138,8 @@ function bbcode($Text,$preserve_nl = false) {
$Text = preg_replace("(\[color=(.*?)\](.*?)\[\/color\])ism","<span style=\"color: $1;\">$2</span>",$Text);
// Check for sized text
// [size=50] --> font-size: 50px (with the unit).
$Text = preg_replace("(\[size=(\d*?)\](.*?)\[\/size\])ism","<span style=\"font-size: $1px;\">$2</span>",$Text);
$Text = preg_replace("(\[size=(.*?)\](.*?)\[\/size\])ism","<span style=\"font-size: $1;\">$2</span>",$Text);
// Check for list text