BBcode is an intermediate form of limited HTML that allows users some basic formatting without allowing the whole of what HTML supports. auLib provides functions in the auText class to convert between BBcode and HTML. This page lists the formatting supported.
Any text between
[/b] is formatted bold using the HTML b tag.
Any text between
[/i] is formatted italic using the HTML i tag.
Hyperlinks can be created using either
url; it’s even possible to mix the two, opening with one and closing with the other. The value after the equal sign should be a valid URL but doesn’t need to start with
http:// (it’s acceptable to use something like
#id to link to something on the same site or even the same page, for example). The linked text is used as the text of the hyperlink.
There are two options for quotes. The first example shows a quote with attribution while the second only indicates that whoever is posting the quote didn’t write it. Both cases enclose the quoted text in the HTML blockquote tag. The first case also includes an HTML cite tag before the quote with “author says:” as its contents. Features that allow a user to reply to another user would normally use the first method to include the quoted username as the author and their post contents as quoted text.
[numbers] first list item second list item [/numbers]
[bullets] first list item second list item [/bullets]
Both numbered and bulletted lists are available by putting each list item on its own line and surrounded by either
[bullets] accordingly. At this time, lists may only have one level.
[code] code block [/code]
non-code text [code]inline code[/code] more non-code text
There are two options for code, both using the same BBcode tag. Inline code needs to have both
[/code] on the same line, and they cannot be at the beginning and end of the line (otherwise it looks like a one-line code block). Inline code uses the HTML code tag while code blocks use the HTML samp tag.
Headings (and subheadings) are ignored by default and must be enabled in auText::BB2HTML() by passing true for the $head parameter. Headings become the HTML h2 tag and subheadings become h3.