1. Mai. 2012, 22:26

This document uses (almost) all BBCode tags supported by Drupal's BBCode module. You can cut and paste this document into a node to test Drupal's BBCode implementation or to perform some benchmarks.


Normal text formatting

Test bold / [strong]strong[/strong] text
Test italic / [em]emphasised[/em] text
Test underlined text
Test strikeout text
Test subscript text - H2O
Test superscript text - X3

Font colors

Test blue text
Test red text
Test green text
Test #eeff00 text

Font sizes

Test 1px - too small, normalized to 6px
Test 12px text
Test 24px text
Test 100px - too big, normalized to 48px
$_SERVER[PHP_SELF] "quoted" \\e\s\c\aped\" - watch out for eval

Font faces

Test Arial typeface text
Test Arial typeface text
Test Courier typeface text
Test Courier New typeface text
Test Impact typeface text
Test Helvetica typeface text
Test Times New Roman typeface text
Test Verdana typeface text

Text alignment

[left]Left hand side of the screen[/left]
[right]Right hand side of the screen[/right]
[justify]This paragraph is justified on both sided on the page. By default most browsers render text with a jagged right edge. If you want all text rendered like in a book with an even right edge - use the justify tag.[/justify]


Normal image:

Align image right:

Image with ALT description:

Re-sized image:

Test URL

Anchor (bookmark you can link to):
[anchor=TEST]URL Anchor[/anchor]

Some URL's within a sentence:;, ( and And some more:, ( and

Google link: [google]BBCode[/google]
Wikipedia link: [wikipedia]BBCode[/wikipedia]
Youtube video: [youtube]0Q2aPi9ZEgs[/youtube]

E-mail addresses
Joe Smith


Level 1 Heading

Level 2 Heading

Level 3 Heading

Level 4 Heading

Acronyms and abbreviations

[abbr=Application Programming Interface]API[/abbr]
[abbr=Content Management System]CMS[/abbr]
[abbr=World Wide Web]WWW[/abbr]
[abbr=2.54cm]1 inch[/abbr]

[acronym=Structured Query Language]SQL[/acronym]
[acronym=Graphics Interchange Format]GIF[/acronym]
[acronym=Radio Detecting and Ranging]radar[/acronym]

Code blocks

Normal code block:
x := y + z;
y := a - b;

An inline code block

Color highlighted PHP code block:
echo "Sample PHP code";

Test notag:
[notag]These BBCode tags are not converted to HTML![/notag]
[notag]I'm happy[/notag]


A simple quote:
This is a quoted message

Quote with source:
This is a quoted message

Nested quotes:
This is a quoted message
This is a nested quote


A normal list (circular bullets, same as list=c):
  1. foo
  2. bar
  3. baz

List with circular buttets (list=c):

  1. x
  2. y
  3. z

List with discs (list=d):

  1. x
  2. y
  3. z

List with squares (list=s):

  1. x
  2. y
  3. z

Numeric list (list=1):

  1. x
  2. y
  3. z

Roman lowercase list (list=i):

  1. x
  2. y
  3. z

Roman uppercase list (list=I):

  1. x
  2. y
  3. z

Alpha lowercase list (list=a):

  1. x
  2. y
  3. z

Alpha uppercase list (list=A):

  1. x
  2. y
  3. z

Simple nested lists:
  1. foo
    1. bar
  2. baz

Complex nested list:

  1. list=foo

    1. list=s
    2. list=s

    1. list=a

      1. list=I
      2. list=I

    2. list=a

  2. list=bar

    1. list=A
    2. list=A
    3. list=A

  3. list=baz

    1. list=d
    2. list=d

List with php content (watch out for eval):
  1. {$var $_SERVER[PHP_SELF] "quoted" \\e\s\c\aped\"

Table tags


[r color=grey]
[r color=lightyellow]
[r color=yellow]

Other tags

Horizontal delimiter:

Force line break:

Force space:

Tag nesting

10px 20px 30px 20px 10px
Arial Century Comic sans MS Arial Arial Bold Italic Arial

Test multi-line tags:


Cross site scripting (XSS) vulnerabilities

User-entered text with embedded script tags <script>alert(document.cookie);</script> will be encoded.

Some other exploits:
Size tag
Font tag
[float=expression(alert(document.cookie));]Float tag[/float]
Click here to see cookie

Broken tags

We need to ensure that bad formatting will not disrupt your site's HTML.

Broken bold text...

  1. A broken list...

    A broken quote...


  • IanAR

    Good effort, Freddie - Of the non-workers, [*anchor]'s and [*table]/etc. are top of my wish-list for Last.FM. I'm sure this'd be welcome on the BBCode Brigade journal. - Ian

    1. Sep. 2013, 0:46
Alle Kommentare anzeigen
Sage etwas. Melde dich bei an oder registriere ein neues Benutzerkonto (es kostet nichts).