BBCode
Development status | Active |
---|---|
Operating system | Cross-platform |
Type | message board |
Website | http://php.net/manual/en/book.bbcode.php |
BBCode or Bulletin Board Code is a lightweight markup language used to format posts in many message boards. The available tags are usually indicated by square brackets ([ ]) surrounding a keyword, and they are parsed by the message board system before being translated into a markup language that web browsers understand—usually HTML or XHTML.[1]
BBCode was introduced in 1998 by the messageboard software Ultimate Bulletin Board (UBB) implemented in Perl. In 2000 BBCode was used in PhpBB - an internet forum system written in PHP.
Tags
BBCode | Example HTML / CSS | Output | ||||
[b]bolded text[/b]
|
<b>bolded text</b>
<strong>bolded text</strong>
<span style="font-weight: bold;">bolded text</span>
|
bolded text | ||||
[i]italicized text[/i]
|
<i>italicized text</i>
<em>italicized text</em>
<span style="font-style: italic;">italicized text</span>
|
italicized text | ||||
[u]underlined text[/u]
|
<u>underlined text</u>
<ins>underlined text</ins>
<span style="text-decoration: underline;">underlined text</span>
|
underlined text | ||||
[s]strikethrough text[/s]
|
<s>strikethrough text</s>
<del>strikethrough text</del>
<span style="text-decoration: line-through;">strikethrough text</span>
|
| ||||
[url]http://example.org[/url]
|
<a href="http://example.org">http://example.org</a>
|
http://example.org | ||||
[url=http://example.com]Example[/url]
|
<a href="http://example.com">Example</a>
|
Example | ||||
[img]http://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Go-home.svg/100px-Go-home.svg.png[/img]
|
<img src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Go-home.svg/100px-Go-home.svg.png" alt="" />
|
|||||
[quote="author"]quoted text[/quote]
(including optional author ) |
<blockquote><p>quoted text</p></blockquote>
(usually implemented in more advanced ways) |
To quote:quoted text | ||||
[code]monospaced text[/code]
|
<pre>monospaced text</pre>
|
monospaced text | ||||
[style size="15px"]Large Text[/style]
(The unit of measurement varies with each BBCode variant and could represent pixels, points, or relative HTML sizes.) |
<span style="font-size:15px">Large Text</span>
<font size="(+,-)x">Different text-size</font> (you can set + or - and x is a number representing pixels
|
Large Text | ||||
[style color="red"]Red Text[/style]
or [style color=#FF0000]Red Text[/style]
[color=#FF0000]Red Text[/color]
|
<span style="color:#FF0000;">Red Text</span>
<font color="red">Red Text</font>, <span style="color:#FF0000;">Red Text</span>
<span style="color:red;">Red Text</span>
<span style="color:red;">Red Text</span>
|
|||||
:)
[:-)]
this would be another way to use the |
<img src="Face-smile.svg" alt=":-)">
|
(Specific image and size vary) | ||||
[list]
[*]Entry 1
[*]Entry 2
[/list]
Some message boards do not need the square brackets around the markers, e.g.: [list]
*Entry 1
*Entry 2
[/list]
(many variants for li and /li, list types (unordered and ordered, with different bullets or counter formats), etc.) |
<ul><li>Entry 1</li><li>Entry 2</li></ul>
|
| ||||
[table]
[tr]
[td]table 1[/td]
[td]table 2[/td]
[/tr]
[tr]
[td]table 3[/td]
[td]table 4[/td]
[/tr]
[/table]
(some variants for thead, rules, etc.) |
<table><tr><td>table 1</td><td>table 2</td></tr><tr><td>table 3</td><td>table 4</td></tr></table>
|
|
Implementation
BBCode is typically implemented by applying a series of regular expression string-replace operations upon the input. Because regular expressions are limited in analyzing the structure of text input, this has the artifact that any non-hierarchical BBCode input will be transformed into invalid non-hierarchical HTML without error.
Applying traditional parsing techniques is made difficult by ambiguities in the markup, such as in [quote=[b]text[/b][/quote]
, where the input can either be interpreted as "text" quoted from someone called "[b", or the bolded text "text" surrounded by "[quote=" and "[/quote]", i.e. "[quote=text[/quote]".
References
- ↑ "Why modern forums are switching from HTML to BBCode". www.lovelyreality.com. Retrieved 24 May 2015.
- ↑ BOINC Project Forums et al.
Links
- BBCode Reference List - A tabular list of BBCodes
- Any2Bb.com - Rich-text (and HTML) to BbCode online converter
- "bbcode users guide and tricks on implementing it". BBCode.org. Silicon.dk ApS. 2011. Retrieved 9 July 2015.