Browse Source

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.
pull/33/head
Abinoam P. Marques Jr 11 years ago
parent
commit
74b529bda2
  1. 2
      include/bbcode.php

2
include/bbcode.php

@ -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

Loading…
Cancel
Save