KEMU Documents server
JavaScript failed !
So this is static version of this website.
This website works a lot better in JavaScript enabled browser.
Please enable JavaScript.
This section describes general rules of BB-code 2.0.
Those rules are not directly related to most common use of KBB, which is KBB-to-HTML. Those are generic rules for any KBB application.

Simple BB tag

The simple BB Tag looks like this:
ⓘ Example usage:

It's just made of:
  • a [ character - which opens a tag,
  • then name of a tag (this will be "myTag" in this case)
  • and then ] character - which closes a tag,
So if we say: "use tag img", it means you should write [img].


As you can see, the [ character is always opening a tag. In case you want to render [ as normal character (escape), just write two of them, like this: [[


In some BB tags you can define additional settings. For example set a color or define path to image file.
Usually BB tag accepts a single setting as a pair of key and value. For example: key may be "theColor" and the value may be "red".
So the example tag "myColor" with a setting "theColor" set to "red" looks like that:
ⓘ Example usage:
[myColor theColor=red]

Also simple parameters, with no value attached are correct. Like this:
ⓘ Example usage:
[theTag paramA]

More parameters

If you need to pass more parameters, just put them one after another, separating with space like this:
ⓘ Example usage:
[myColor theColor=red theBackground=green theNumber=3]

Tag open-close rules

We discussed simple tags, which just have a name and some parameters. Those tags don't open anything, so they don't have to be closed.

But there are also more complicated tags, which have 2 parts: opening part and closing part.

The good example of open-close tag is tag to make bold text. We use [b] tag for that. We need to say where to start bold text and where the bold text ends. We do it this way:
ⓘ Example usage:

So this BB-Code:
ⓘ Example usage:
This is a [b]bold word[/b] and this is [i]italic word[/i] and this is [u]underline[/u]
looks like this after rendering to html:
This is a bold word and this is italic word and this is underline

Open, open, close, close

You can put one open-close tag "inside" of another like this:
ⓘ Example usage:
This is [b]bold and [u]underlined text[/u][/b]
which will emit this:
This is bold and underlined text

In old-school BB-Code you need to ensure the closings are in opposite order than openings.
So this would be illegal in old BB: [b][u][/b][/u] - because there is: open b, open u and then close b. And you can't close b because there is still u opened. This means that generated HTML will be invalid.
However in KemuBB it is correct to do it as KemuBB will close and reopen html tags in proper order automagically.

Closing tag autodetection

Also in Kemu-BB most of the tags are auto-closable. It means you don't need to worry of closing tags in proper order. Instead of:
ⓘ Example usage:
[b][u]The bold and underlined[/u][/b]
you can use [/] - as auto-close:
ⓘ Example usage:
[b][u]The bold and underlined[/][/]
So the tag [/] will just try to guess which tag needs to be closed - and closes it. But remember - it closes just ONE tag.
There are some tags that are not auto-closable for different reasons. Look intto "tag list" chapter for further reference.

Parameters formatting

The tag, the key and the value must contain only a-z, A-Z, 0-9 and _ characters (so only letters, ciphers and _).
No white-char is allowed, no non-ASCII characters allowed, only simple letters and ciphers.
So this is legal:
ⓘ Example usage:
[the_VeryLong_Name_Of_a_tag andVeryStrange___andLOngParameterKey=longValue aNumber=2]
but this is not (because of spaces !):
ⓘ Example usage:
[the VeryLong Name_Of_a_tag andVeryStrange__ andLOngParameterKey=longValue]

Putting text to parameter

If you need to pass a text as a value of parameter, which contains spaces or disallowed characters, do it this way:
ⓘ Example usage:
[theTag theKey="The long text which is a value"]
You can use use single quotation or double quotation - whatever you prefer.

So for example, putting url to image should be always with "" or '':
ⓘ Example usage:
[image url=""]
ⓘ Example usage:
[image url='']

Putting " or ' inside of text parameter

If you need to pass " or ' in a text parameter, it may be interpreted as an end or beginning of a parameter itself. To avoid that just repeat same character (make double ' or double ").
For example, to pass a text abc'd as a parameter you can do:
ⓘ Example usage:
[theTag key="abc''d"]