BBCode

Last updated

BBCode ("Bulletin Board Code") is a lightweight markup language used to format messages in many Internet forum software. It was first introduced in 1998. The available "tags" of BBCode are usually indicated by square brackets ([ and ]) surrounding a keyword, and are parsed before being translated into HTML. [1]

Contents

Tags

Example in HTML/CSSBBCodeOutput
<b>bolded text</b> [2] ,
<strong>bolded text</strong> [1] or
<spanstyle="font-weight: bold;">bolded text</span>
[b]bolded text[/b]bolded text
<i>italicized text</i>,
<em>italicized text</em> or
<spanstyle="font-style: italic;">italicized text</span>
[i]italicized text[/i]italicized text
<ins>underlined text</ins> or
<spanstyle="text-decoration: underline;">underlined text</span>
[u]underlined text[/u]underlined text
<del>strikethrough text</del> or
<spanstyle="text-decoration: line-through;">strikethrough text</span>
[s]strikethrough text[/s]strikethrough text
<ahref="https://en.wikipedia.org">https://en.wikipedia.org</a>
<ahref="https://en.wikipedia.org">English Wikipedia</a>
[url]https://en.wikipedia.org[/url]
[url=https://en.wikipedia.org]English Wikipedia[/url]
https://en.wikipedia.org
English Wikipedia
<imgsrc="https://upload.wikimedia.org/wikipedia/commons/7/70/Example.png"alt="This is just an example"/>[imgalt="Thisisjustanexample"]https://upload.wikimedia.org/wikipedia/commons/7/70/Example.png[/img]Example.png
<imgsrc="Smileys/Face-smile.svg"alt=":-)">:) or [:-)]
This would be another way to use the [img]url_img[/img] and must be pre-configured by the forum administrator.
(This and other emoticons, depending on the variant. Most BBCodes do not enclose emoticons in square brackets, leading to frequent accidental usage.)
Face-smile.svg
(Specific image and size vary.)
<blockquote><p>quoted text</p></blockquote>
(Usually implemented in more advanced ways.)
[quote]quoted text[/quote]
[quote="author"]quoted text[/quote]
(including optional author)
Using a Wikipedia template:

quoted text

quoted text

author
<pre>monospaced text</pre>[code]monospaced text[/code]monospaced text
<spanstyle="font-size:30px">Large Text</span> or
<spanstyle="font-size:85%">Smaller Text</span>
[stylesize="30px"]Large Text[/style]
[stylesize="85"]Smaller Text[/style]
(The unit of measurement varies with each BBCode variant and could represent pixels, points, or relative HTML sizes.)
Large Text
Smaller Text
<spanstyle="color:fuchsia;">Text in fuchsia</span> or
<spanstyle="color:#FF00FF;">Text in fuchsia</span>
[stylecolor="fuchsia"]Text in fuchsia[/style] or
[stylecolor=#FF00FF]Text in fuchsia[/style] or
[color=#FF00FF]Text in fuchsia[/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.)
Text in fuchsia
<ul><li>Entry A</li><li>Entry B</li></ul><ol><li>Entry 1</li><li>Entry 2</li></ol>
[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. [3]

(Many variants for li and /li, list types – unordered and ordered, with different bullets or counter formats – etc.)

  • Entry A
  • Entry B
  1. Entry 1
  2. Entry 2
<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>
[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 thead, rules, etc.)

table cell 1table cell 2
table cell 3table cell 4
Source: [4]

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 ]

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].

See also

Related Research Articles

<span class="mw-page-title-main">HTML</span> HyperText Markup Language

The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It defines the content and structure of web content. It is often assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScript.

<span class="mw-page-title-main">Markup language</span> Modern system for annotating a document

A markuplanguage is a text-encoding system which specifies the structure and formatting of a document and potentially the relationship between its parts. Markup can control the display of a document or enrich its content to facilitate automated processing.

<span class="mw-page-title-main">Standard Generalized Markup Language</span> Markup language

The Standard Generalized Markup Language is a standard for defining generalized markup languages for documents. ISO 8879 Annex A.1 states that generalized markup is "based on two postulates":

<span class="mw-page-title-main">XML</span> Markup language by the W3C for encoding of data

Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. The World Wide Web Consortium's XML 1.0 Specification of 1998 and several other related specifications—all of them free open standards—define XML.

Mathematical Markup Language (MathML) is a mathematical markup language, an application of XML for describing mathematical notations and capturing both its structure and content, and is one of a number of mathematical markup languages. Its aim is to natively integrate mathematical formulae into World Wide Web pages and other documents. It is part of HTML5 and standardised by ISO/IEC since 2015.

An HTML element is a type of HTML document component, one of several types of HTML nodes. The first used version of HTML was written by Tim Berners-Lee in 1993 and there have since been many versions of HTML. The current de facto standard is governed by the industry group WHATWG and is known as the HTML Living Standard.

Parsing, syntax analysis, or syntactic analysis is the process of analyzing a string of symbols, either in natural language, computer languages or data structures, conforming to the rules of a formal grammar. The term parsing comes from Latin pars (orationis), meaning part.

YAML(see § History and name) is a human-readable data serialization language. It is commonly used for configuration files and in applications where data is being stored or transmitted. YAML targets many of the same communications applications as Extensible Markup Language (XML) but has a minimal syntax that intentionally differs from Standard Generalized Markup Language (SGML). It uses Python-style indentation to indicate nesting and does not require quotes around most string values.

Pretty-printing is the application of any of various stylistic formatting conventions to text files, such as source code, markup, and similar kinds of content. These formatting conventions may entail adhering to an indentation style, using different color and typeface to highlight syntactic elements of source code, or adjusting size, to make the content easier for people to read, and understand. Pretty-printers for source code are sometimes called code formatters or beautifiers.

In web development, "tag soup" is a pejorative for syntactically or structurally incorrect HTML written for a web page. Because web browsers have historically treated structural or syntax errors in HTML leniently, there has been little pressure for web developers to follow published standards, and therefore there is a need for all browser implementations to provide mechanisms to cope with the appearance of "tag soup", accepting and correcting for invalid syntax and structure where possible.

A lightweight markup language (LML), also termed a simple or humane markup language, is a markup language with simple, unobtrusive syntax. It is designed to be easy to write using any generic text editor and easy to read in its raw form. Lightweight markup languages are used in applications where it may be necessary to read the raw document as well as the final rendered output.

<span class="mw-page-title-main">Markdown</span> Plain text markup language

Markdown is a lightweight markup language for creating formatted text using a plain-text editor. John Gruber and Aaron Swartz created Markdown in 2004 as a markup language that is intended to be easy to read in its source code form. Markdown is widely used for blogging and instant messaging, and also used elsewhere in online forums, collaborative software, documentation pages, and readme files.

In typography and especially computer typography, white space or whitespace is any character or series of characters that represent horizontal or vertical space. When rendered, a whitespace character does not correspond to a visible mark, but typically does occupy an area on a page. For example, the common whitespace symbol U+0020 SPACE represents a blank space punctuation character in text, used as a word divider in Western scripts.

OmniMark is a fourth-generation programming language used mostly in the publishing industry. It is currently a proprietary software product of Stilo International. As of July 2022, the most recent release of OmniMark was 11.0.

Data exchange is the process of taking data structured under a source schema and transforming it into a target schema, so that the target data is an accurate representation of the source data. Data exchange allows data to be shared between different computer programs.

Extensible HyperText Markup Language (XHTML) is part of the family of XML markup languages which mirrors or extends versions of the widely used HyperText Markup Language (HTML), the language in which Web pages are formulated.

Setext is a lightweight markup language used to format plain text documents such as e-newsletters, Usenet postings, and e-mails. In contrast to some other markup languages, the markup is easily readable without any parsing or special software.

The Sweble Wikitext parser is an open-source tool to parse the Wikitext markup language used by MediaWiki, the software behind Wikipedia. The initial development was done by Hannes Dohrn as a Ph.D. thesis project at the Open Source Research Group of professor Dirk Riehle at the University of Erlangen-Nuremberg from 2009 until 2011. The results were presented to the public for the first time at the WikiSym conference in 2011. Before that, the dissertation was inspected and approved by an independent scientific peer-review and was published at ACM Press.

A document type declaration, or DOCTYPE, is an instruction that associates a particular XML or SGML document with a document type definition (DTD). In the serialized form of the document, it manifests as a short string of markup that conforms to a particular syntax.

In markup languages and the digital humanities, overlap occurs when a document has two or more structures that interact in a non-hierarchical manner. A document with overlapping markup cannot be represented as a tree. This is also known as concurrent markup. Overlap happens, for instance, in poetry, where there may be a metrical structure of feet and lines; a linguistic structure of sentences and quotations; and a physical structure of volumes and pages and editorial annotations.

References

  1. 1 2 "Why modern forums are switching from HTML to BBCode". LovelyReality.com. Archived from the original on 2018-09-01. Retrieved 24 May 2015.
  2. "HTML Text Formatting". W3Schools. Retrieved 2021-05-01.
  3. e.g. BOINC Project Forums et al.
  4. "BBCode tags reference". www.bbcode.org. Retrieved 12 January 2022.