http://libcom.org/notes/content-guidelines/bbcode

RSS
Weiterleiten

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.

[index]
[hr]

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]
[center]Centered[/center]
[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]

Images



Normal image:


Align image right:


Image with ALT description:


Re-sized image:


URL's


www.test-url.com
ftp.test-url.com
http://test-url.com/~user/,part,of,url
ftp://test-url.com:8080/
http://test-url.com/
Test URL

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

Some URL's within a sentence: http://url1.com; www.url2.com, (www.url3.com) and www.url4.com. And some more: ftp://url5.com/, (ftp.url6.com/) and ftp.url7.com.

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

E-mail addresses


Test@Mail.com
drupal.user@server1.drupal.org
joe@example.com
Joe Smith

Headings


Level 1 Heading


Level 2 Heading


Level 3 Heading


Level 4 Heading



Acronyms and abbreviations


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]

Acronyms:
[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:
[php]
<?php
echo "Sample PHP code";
?>
[/php]

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

Quoting



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


Lists



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



[table]
[row]
[col]row1col1[/col]
[col]row1col2[/col]
[/row]
[row]
[col]row2col1[/col]
[col]row2col2[/col]
[/row]
[/table]

[table]
[r color=grey]
[h]Header1[/h]
[h]Header2[/h]
[/r]
[r color=lightyellow]
[c]row1col1[/c]
[c]row1col2[/c]
[/r]
[r color=yellow]
[c]row2col1[/col]
[c]row2col2[/col]
[/r]
[/table]

Other tags



Horizontal delimiter:
[hr]

Force line break:
--&gt;[br]&lt;--

Force space:
--&gt;[sp]&lt;--

Tag nesting


10px 20px 30px 20px 10px
BLUE RED GREEN BLUE
Arial Century Comic sans MS Arial Arial Bold Italic Arial

Test multi-line tags:




test



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
[anchor=javascript:alert(document.cookie)]Anchor[/anchor]
javascript:document.location='http://www.albinoblacksheep.com/flash/you.html'
javascript:al&#x65rt('XSS')
http://host.com/?act=SR&f='><script>alert(document.cookie)</script>

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

Kommentare

  • 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 Last.fm an oder registriere ein neues Benutzerkonto (es kostet nichts).