]> git.mxchange.org Git - friendica.git/commitdiff
Added [center] bbcode support.
authorAbinoam P. Marques Jr <abinoam@gmail.com>
Sun, 12 Feb 2012 23:51:17 +0000 (15:51 -0800)
committerAbinoam P. Marques Jr <abinoam@gmail.com>
Sun, 12 Feb 2012 23:51:17 +0000 (15:51 -0800)
include/bbcode.php

index fa5b7e0806d6f26780d12287c8aa6373dd3ff121..20418f940719f75d1952144a83b17e1e9369cba5 100755 (executable)
@@ -142,6 +142,9 @@ function bbcode($Text,$preserve_nl = false) {
        $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 centered text
+       $Text = preg_replace("(\[center\](.*?)\[\/center\])ism","<div style=\"text-align:center;\">$1</div>",$Text);
+
        // Check for list text
 
        if(stristr($Text,'[/(list|ul|ol)]'))