from Wikipedia, the free encyclopedia

BBCode (from English Bulletin Board Code ) is a HTML- based, but simplified markup language that is preferred for creating articles in web forums (English Bulletin Boards ). BBCode is not officially regulated , but because of its widespread use it represents a quasi-standard and best current practice .

BBCode was first introduced in 1998 in the Ultimate Bulletin Board (UBB) version 3 web forum software and is accordingly sometimes referred to as UBB Code .


Many text markups work in the same way as HTML in BBCode , for example , and . In addition, not provided directly by HTML possible BBCode allows even complex elements such as lists, which are defined as follows: . [b]fett[/b][i]kursiv[/i][u]unterstrichen[/u][list] [*]Eintrag 1 [*]Eintrag 2[/list]

Often, BBCode is available via an easy-to-use interface above or below the input form - similar to common text editors. This is then done in conjunction with JavaScript or server-side programming languages ​​such as PHP or Perl . There are also pop-ups in which the text to be marked, the list elements, etc. can be entered. Of course you can also enter the elements by hand.

By using BBCode, users can mark up texts in a similar way to HTML without having to allow HTML to be entered. Security-critical elements such as JavaScript or tags that interfere with the layout of the website can thus generally be excluded. Filtering out dangerous HTML tags (while allowing non-dangerous ones at the same time) can easily prove to be error-prone or inadequate.

Structure and scope

In contrast to other markup languages , BBCode is not officially regulated, so it differs from implementation to implementation. However, the basic structure and scope are largely the same and form a de facto standard. Larger forums that specialize in one topic often extend the standard set of BBCodes with some of their own.

element Award in BBCode Equivalent in XHTML
Award element [elementname]Inhalt[/elementname] <elementname>Inhalt</elementname>(Note)
simple font formatting
<b>fett</b> oder <strong>fett</strong>
<i>kursiv</i> oder <em>kursiv</em>
<span style="text-decoration:underline;">unterstrichen</span>
<span style="text-decoration:line-through;">durchgestrichen</span>,
in HTML5 auch: <del>durchgestrichen</del>
<p style="text-align:center;">zentriert</p>
advanced font formatting
[color=farbe]farbiger Text[/color]
<span style="font-family:schriftart;">Text</span>
<span style="color:farbe;">farbiger Text</span>
<span style="font-size:schriftgröße;">Text</span>
... lorem ipsum
dolor ...
<p>... lorem ipsum</p>
<p>dolor ...</p>
Bulleted list without numbering
Bulleted list with numbering in Arabic numerals
Bulleted list with numbering in (small) Roman numerals
<ol type="i">
Bulleted list with numbering in (small) letters
<ol type="a">
<a href="">Linktext</a>
<a href=""></a>
<img src="" alt="bild.jpg" />
:-) oder :)
<img src="/smileys/happy.png" alt="Smiley" />
Source code
Code jeglicher Art
Code jeglicher Art

The real HTML syntax is usually more advanced than shown here.

Quotes (only as block quotations )
<blockquote><div class="postedby">Zitat von Autor</div><p>Zitat</p></blockquote>

The parsing from BBCode to HTML is very inconsistent , especially when the author is named . There are usually other elements within the block quota. <blockquote>

(Note) Any line breaks within the HTML elements that can be seen in the table are due to the individual window width. They are not included in the source code.


In order for BBCode not to be displayed as such in the web browser , but to cause special formatting, it must first be processed by a parser . By using regular expressions, for example, this searches the entered text for the replacement of characters that have a special meaning in HTML, specifically for BBCode tags before it is delivered to the browser, and replaces them with corresponding HTML tags. Syntax errors, such as a standalone one, [b]can be fixed using HTML Tidy , for example .

Web links

Individual evidence

  1. What is UBB Code?