Needs proper documentation! [color=red]

Aug 1, 2012 at 9:06 PM

Linus Torvalds once said that he attributes Linux's success to good documentation.


So anyway, an hour later I worked out how to do;

[color=red]my text[/color] --> <span style="color: red">my text</span>

BBAttribute(id, name), "id" place in the string "${id}" and "name" is the source attribute name. If name is empty, then it is the default attribute.

For example;

new BBTag("img", "<img src=\"${cake}\" />", "", new BBAttribute("cake","nice")),      

converts "  [img nice=yummy] " into "<img src=\"yummy /> "

And so for color...

new BBTag("color", "<span style=\"color: ${color} \">","</span>", new BBAttribute("color",""))          

turns " [color=red] " into "<span style=\"color: red\">" since the "name" in attribute is "".

fyi: my blog: