]> git.mxchange.org Git - friendica.git/commitdiff
BBCode [size=50] --> font-size: 50px (with the unit px).
authorAbinoam P. Marques Jr <abinoam@gmail.com>
Sun, 12 Feb 2012 22:59:07 +0000 (14:59 -0800)
committerAbinoam P. Marques Jr <abinoam@gmail.com>
Sun, 12 Feb 2012 22:59:07 +0000 (14:59 -0800)
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.

include/bbcode.php

index 3534a7315fafc9385bc71beea105d59c42785e81..fa5b7e0806d6f26780d12287c8aa6373dd3ff121 100755 (executable)
@@ -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