BBCode

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 .

description

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]
[i]kursiv[/i]
[u]unterstrichen[/u]
[s]durchgestrichen[/s]
[center]zentriert[/center]
<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
[font=schriftart]Text[/font]
[color=farbe]farbiger Text[/color]
[size=schriftgröße]Text[/size]
<span style="font-family:schriftart;">Text</span>
<span style="color:farbe;">farbiger Text</span>
<span style="font-size:schriftgröße;">Text</span>
structure
... lorem ipsum
(Leerzeile)
dolor ...
<p>... lorem ipsum</p>
<p>dolor ...</p>
Bulleted list without numbering
[list]
[*]Punkt
[*]Punkt
[/list]
<ul>
<li>Punkt</li>
<li>Punkt</li>
</ul>
Bulleted list with numbering in Arabic numerals
[list=1]
[*]Punkt
[*]Punkt
[/list]
<ol>
<li>Punkt</li>
<li>Punkt</li>
</ol>
Bulleted list with numbering in (small) Roman numerals
[list=i]
[*]Punkt
[*]Punkt
[/list]
<ol type="i">
<li>Punkt</li>
<li>Punkt</li>
</ol>
Bulleted list with numbering in (small) letters
[list=a]
[*]Punkt
[*]Punkt
[/list]
<ol type="a">
<li>Punkt</li>
<li>Punkt</li>
</ol>
References
[url=http://example.com]Linktext[/url]
[url]http://example.com[/url]
<a href="http://example.com">Linktext</a>
<a href="http://example.com">http://example.com</a>
photos
[img]example.com/bild.jpg[/img]
<img src="http://example.com/bild.jpg" alt="bild.jpg" />
Smileys
:-) oder :)
<img src="/smileys/happy.png" alt="Smiley" />
Source code
[code]
Code jeglicher Art
[/code]
<pre>
Code jeglicher Art
</pre>

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

Quotes (only as block quotations )
[quote]Zitat[/quote]
[quote=Autor]Zitat[/quote]
<blockquote>Zitat</blockquote>
<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.

parsing

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. scriptkeeper.com: What is UBB Code?