BBCodeParser icon indicating copy to clipboard operation
BBCodeParser copied to clipboard

is there anyway to do this [color=colornameorhexcodehere]TEXTHERE[/color]

Open bluethefoxyt opened this issue 8 years ago • 1 comments

bluethefoxyt avatar Oct 03 '17 16:10 bluethefoxyt

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

kolomu avatar Oct 05 '17 18:10 kolomu