Saturday, 28 September 2013

BBcode parser, size not changing

BBcode parser, size not changing

I am using a simple BBCode parser, which I have had to manipulate and add
things to as it has a limited number of commands, which then I have had to
extend. Everything else works perfectly, but the size is just not
changing. It does not show the BBCode tags, so it is converting it to
something but it is not recognising the change in the font-size I guess.
Any ideas?
/* Size */
$match["size"] = "/\[size=([0-7]+(%|px|em)?)\](.*?)\[\/size\]/is";
$replace["size"] = "<span style=\"font-size: $1;\">$3</span>";
$bbcode = preg_replace($match, $replace, $bbcode); ....etc.
I put the size from 0-7 here as the size possibilities only go up to 7 in
my editor...

No comments:

Post a Comment