BBCode
{{Short description|Lightweight markup language used in message boards}}
{{distinguish|BBC}}
BBCode ("Bulletin Board Code") is a lightweight markup language used to format messages in many Internet forum software. It was first introduced in 1998.{{cite web |title=BBCode history |url=https://www.bbcode.org/history.php |website=www.bbcode.org |access-date=21 February 2025}} The available "tags" of BBCode are usually indicated by square brackets ([
and ]
) surrounding a keyword, and are parsed before being translated into HTML.{{cn|date=December 2024}}
Tags
class="wikitable" style="width:100%; text-align:left;"
! style="width:40%;" | Example in HTML/CSS ! style="width:40%;" | BBCode ! style="width:20%;" | Output | ||||
| | bolded text | ||||
| | italicized text | ||||
| | underlined text | ||||
| | | ||||
| | [https://en.wikipedia.org https://en.wikipedia.org] | ||||
![]() | | ||||
| | File:Face-smile.svg | ||||
(Usually implemented in more advanced ways.) | | Using a Wikipedia template: {{quote|text=quoted text}}{{quote|author=author|text=quoted text}} | ||||
monospaced text | | | ||||
| | Large Text | ||||
| | Text in fuchsia | ||||
| [list] [*]Entry A [*]Entry B [/list] [list=1] [*]Entry 1 [*]Entry 2 [/list] Some message boards do not need the square brackets around the markers.e.g. BOINC Project Forums et al. (Many variants for |
| ||||
| [table] [tr] [td]table cell 1[/td] [td]table cell 2[/td] [/tr] [tr] [td]table cell 3[/td] [td]table cell 4[/td] [/tr] [/table] (Some variants for | {| class="wikitable" | ||||
| table cell 1
| | table cell 2 | ||||
| table cell 3
| | table cell 4 |
|-
| colspan="3" style="text-align: center;" | Source:{{cite web |title=BBCode tags reference |url=https://www.bbcode.org/reference.php |website=www.bbcode.org |access-date=12 January 2022}}
|}
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.{{Citation needed|date=January 2022}}
Applying traditional parsing techniques is made difficult by ambiguities in the markup, such as in {{code|1=[quote=[b]text[/b][/quote]}}, where the input can either be interpreted as "text" quoted from someone called {{code|[b}}, or the bolded text "text" surrounded by {{code|1=[quote=}} and {{code|lang=bbcode|code=[/quote]}}, i.e. [quote=text[/quote]
.
See also
References
External links
- [http://www.bbcode.org/ BBCode users guide]
- [https://any2bb.com/ RTF/HTML to BBCode online converter]