BBCode or
Bulletin Board Code is a
lightweight markup languageA lightweight markup language is a markup language with a simple syntax, designed to be easy for a human to enter with a simple text editor, and easy to read in its raw form....
used to format posts in many message boards. The available tags are usually indicated by
square bracketsBrackets are tall punctuation marks used in matched pairs within text, to set apart or interject other text. In the United States, "bracket" usually refers specifically to the "square" or "box" type.-List of types:...
(
[ ]) surrounding a keyword, and they are
parsedIn computer science and linguistics, parsing, or, more formally, syntactic analysis, is the process of analyzing a text, made of a sequence of tokens , to determine its grammatical structure with respect to a given formal grammar...
by the message board system before being translated into a
markup languageA markup language is a modern system for annotating a text in a way that is syntactically distinguishable from that text. The idea and terminology evolved from the "marking up" of manuscripts, i.e. the revision instructions by editors, traditionally written with a blue pencil on authors' manuscripts...
that
web browserA web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...
s understand—usually
HTMLHyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....
or
XHTMLXHTML is a family of XML markup languages that mirror or extend versions of the widely-used Hypertext Markup Language , the language in which web pages are written....
.
BBCode was first introduced in 1998 by the messageboard software
Ultimate Bulletin BoardUBB.classic was an Internet forum software package originally written by Ted O'Neill of Social Strata, Inc. in 1996. It was written in Perl and used a flat file database...
(UBB). This is why BBCode is sometimes referred to as
UBBCode.
Purpose
BBCode was devised to provide a safer, easier and more limited way of allowing users to format their messages. Previously, many message boards allowed the users to include HTML formatting, a side effect of which was that malformed HTML could disrupt the page's layout, or HTML could be used to run
JavaScriptJavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....
leading to
XSSCross-site scripting is a type of computer security vulnerability typically found in Web applications that enables attackers to inject client-side script into Web pages viewed by other users. A cross-site scripting vulnerability may be used by attackers to bypass access controls such as the same...
attacks. Some implementations of BBCode have suffered problems related to the way they translate the BBCode into HTML, which could negate the security that was intended to be given by BBCode. An alternative is a properly written HTML filter (many of which are freely available).
Although the basic tags of BBCode are similar in most
internet forumAn Internet forum, or message board, is an online discussion site where people can hold conversations in the form of posted messages. They differ from chat rooms in that messages are at least temporarily archived...
software, there is currently no standards document for BBCode and there are consequently many incompatible variants. Some variants are
case-sensitiveText sometimes exhibits case sensitivity; that is, words can differ in meaning based on differing use of uppercase and lowercase letters. Words with capital letters do not always have the same meaning when written with lowercase letters....
while others are not. Some variants have tags which highlight the formatting of
HTMLHyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....
,
ASPActive Server Pages , also known as Classic ASP or ASP Classic, was Microsoft's first server-side script engine for dynamically-generated Web pages. Initially released as an add-on to Internet Information Services via the Windows NT 4.0 Option Pack Active Server Pages (ASP), also known as Classic...
,
PHPPHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document...
,
SQLSQL is a programming language designed for managing data in relational database management systems ....
and other
markup languageA markup language is a modern system for annotating a text in a way that is syntactically distinguishable from that text. The idea and terminology evolved from the "marking up" of manuscripts, i.e. the revision instructions by editors, traditionally written with a blue pencil on authors' manuscripts...
s and
programming languageA programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....
s.
BBCode tags
The following are the most common BBCode tags available to most modern message boards, and are displayed here with their HTML equivalents. However, the effect of these tags can be changed substantially, and the effect may not be identical on all sites using BBCode.
| BBCode |
example HTML |
Effect |
[b]bolded text[/b] |
bolded text, bolded text or bolded text |
bolded text |
[i]italicized text[/i] |
italicized text, italicized text or italicized text |
italicized text |
[u]underlined text[/u] |
underlined text, underlined text or underlined text |
underlined text |
[s]strikethrough text[/s] |
strikethrough text, strikethrough text or strikethrough text |
strikethrough text |
[url]http://example.org[/url] |
http://example.org |
http://example.org |
[url=http://example.com]Example[/url] |
Example |
Example |
[img]http://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/Go-home.svg/100px-Go-home.svg.png[/img] |
 |
 |
[quote]quoted text[/quote] |
quoted text
(usually implemented in more advanced ways) |
To quote:quoted text
|
[code]monospaced text[/code] |
monospaced text |
monospaced text |
[size=15]Large Text[/size] (The unit of measurement varies with each BBCode variant and could represent pixels, points, or relative HTML sizes.) |
Large Text |
Large Text |
[color=red]Red Text[/color] or
[color=#FF0000]Red Text[/color] or
[color=FF0000]Red Text[/color] (Both HTML color names and hexadecimal color values are generally supported, although on some boards, you must omit the # from selecting a hexadecimal color.) |
Red Text, Red Text |
Red Text |
:)
[:-)]
this would be another way to use the [img]url_img[/img] and must be pre-configured for the forum administrator
(And other emoticonAn emoticon is a facial expression pictorially represented by punctuation and letters, usually to express a writer’s mood. Emoticons are often used to alert a responder to the tenor or temper of a statement, and can change and improve interpretation of plain text. The word is a portmanteau word... s, depending on the variant) |
 |
(Specific image and size vary) |
[list]
[*]Entry 1
[*]Entry 2
[/list]
|
|
|
[table]
[tr]
[td]table data[/td]
[/tr]
[/table]
(Rarely used) |
|
|
Some forums may allow use the tag [background]. It is used similarly to the [img] tag and should be used with an image filename to display as the post background.
Many message boards include a
FAQFrequently asked questions are listed questions and answers, all supposed to be commonly asked in some context, and pertaining to a particular topic. "FAQ" is usually pronounced as an initialism rather than an acronym, but an acronym form does exist. Since the acronym FAQ originated in textual...
with information on how to use their own variants of BBCode. In addition, some bulletin board systems allow administrators to define their own custom BBCodes. This is usually done by asking them to specify the BBCode markup (utilizing variables/wildcards to indicate the user-customizable parts of the code) and then indicating the XHTML replacement which will be substituted for the BBCode.
Web 2.0The term Web 2.0 is associated with web applications that facilitate participatory information sharing, interoperability, user-centered design, and collaboration on the World Wide Web...
progression of BBCode sees the uncommon occurrence of new tags such as
[youtube], [facebook], and [skype] tags.