BBCodeParser
BBCodeParser copied to clipboard
is there anyway to do this [color=colornameorhexcodehere]TEXTHERE[/color]
Hi, good question, I tried it with the following code but somehow it doesn't work.
bbTags["color"] = new BBTag("color", true, false, false, function (tag, content, attr) { var coloredText = content; return "<span style=\"color: " + attr[color] + " \">" + coloredText + "</span>"; });
With the given input:
var testString4 = "[color=\"#0000cc\"]hey[/color]";
I even tried to copy the exact same pattern like the URL tag. However it seems that "color" is not working..