You are here

bbcode-test.txt in Bbcode 5

Same filename and directory in other branches
  1. 7 bbcode-test.txt
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.

[h3]Normal text formatting:[/h3]
Test [b]bold[/b] text
Test [i]italic[/i] text
Test [u]underlined[/u] text
Test [s]strikeout[/s] text
Test subscript text - H[sub]2[/sub]O
Test superscript text - X[sup]3[/sup]

[h3]Font colors:[/h3]
Test [color=blue]blue[/color] text
Test [color=red]red[/color] text
Test [color=green]green[/color] text
Test [color=#eeff00]#eeff00[/color] text

[h3]Font sizes:[/h3]
Test [size=1]1px[/size] - too small, normalized to 6px
Test [size=12]12px[/size] text
Test [size=24]24px[/size] text
Test [size=100]100px[/size] - too big, normalized to 48px

[h3]Font faces:[/h3]
Test [font=arial]Arial typeface[/font] text
Test [font=Arial Black]Arial typeface[/font] text
Test [font=Courier]Courier typeface[/font] text
Test [font=Courier New]Courier New typeface[/font] text
Test [font=Impact]Impact typeface[/font] text
Test [font=Helvetica]Helvetica typeface[/font] text
Test [font=Times New Roman]Times New Roman typeface[/font] text
Test [font=verdana]Verdana typeface[/font] text

[h3]Text alignment:[/h3]
[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]

[h3]Images:[/h3]

Normal image:
[img]http://upload.wikimedia.org/wikipedia/en/0/0b/Drupallogo.png[/img]

Float image right:
[float=right][img]http://upload.wikimedia.org/wikipedia/en/0/0b/Drupallogo.png[/img][/float]

Image with ALT description:
[img=The Drupal Logo]http://upload.wikimedia.org/wikipedia/en/0/0b/Drupallogo.png[/img]

Re-sized image:
[img=100x50]http://upload.wikimedia.org/wikipedia/en/0/0b/Drupallogo.png[/img]

[h3]Let's test some URLs:[/h3]
www.test-url.com
ftp.test-url.com
http://test-url.com/~user/,part,of,url
ftp://test-url.com:8080/
[url]http://test-url.com/[/url]
[url=http://test-url.com/?q=a+b&z=c]Test URL[/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]

[h3]Let's test some E-mail addresses:[/h3]
Test@Mail.com
drupal.user@server1.drupal.org
[email]joe@example.com[/email]
[email=joe@smith.co.za]Joe Smith[/email]

[h3]Test headings:[/h3]
[h1]Level 1 Heading[/h1]
[h2]Level 2 Heading[/h2]
[h3]Level 3 Heading[/h3]
[h4]Level 4 Heading[/h4]

[h3]Test acronyms and abbreviations:[/h3]
Abbreviations:
[abbr=Application Programming Interface]API[/abbr]
[abbr=Content Management System]CMS[/abbr]
[abbr=World Wide Web]WWW[/abbr]

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

[h3]Code blocks:[/h3]

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

An [code]inline code[/code] block

Color highlighted PHP code block:
[php]
<?php
  echo "Sample PHP code";
?>
[/php]

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

[h3]Quoting[/h3]

A simple quote:
[quote]This is a quoted message[/quote]

Quote with source:
[quote=Frank]This is a quoted message[/quote]

Nested quotes:
[quote=Gabor]This is a quoted message
   [quote=Alastair]This is a nested quote[/quote]
[/quote]

[h3]Lists[/h3]

A normal list (circular bullets, same as list=c):
[list]
[*]x
[*]y
[*]z
[/list]

List with discs (list=d):
[list=d]
[*]x
[*]y
[*]z
[/list]

List with squares (list=s):
[list=s]
[*]x
[*]y
[*]z
[/list]

Numeric list (list=1):
[list=1]
[*]x
[*]y
[*]z
[/list]

Roman lowercase list (list=i):
[list=i]
[*]x
[*]y
[*]z
[/list]

Roman uppercase list (list=I):
[list=I]
[*]x
[*]y
[*]z
[/list]

Alfa lowercase list (list=a):
[list=a]
[*]x
[*]y
[*]z
[/list]

Alfa uppercase list (list=A):
[list=A]
[*]x
[*]y
[*]z
[/list]

A nested list:
[list=s]
[*]x
[*][list=d]
   [*]x.1
   [*]x.2
   [/list]
[*]y
[*]z
[/list]

[h3]Table tags[/h3]

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

[table]
[r]
  [c]row1col1[/c]
  [c]row1col2[/c]
[/r]
[r]
  [c]row2col1[/col]
  [c]row2col2[/col]
[/r]
[/table]

[h3]Other tags[/h3]

Test marquee:
[move]Move tag - creates a scrolling display[/move]

Horizontal delimiter:
[hr]

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

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

[h3]Test tag nesting:[/h3]
[color=red][size=20]large red text[/size][/color]
[size=20][color=red]again - large red test with different tag order[/color][/size]

[h3]Test multi-line tags:[/h3]
[size=20]
  [color=red]
    test
  [/color]
[/size]

[h3]Check for cross site scripting (XSS) vulnerabilities[/h3]
User-entered text with embedded script tags <script>alert(document.cookie);</script> will be encoded.

Some other exploits:
[size=expression(alert(document.cookie));]Size tag[/size]
[font=expression(alert(document.cookie));]Font tag[/font]
[float=expression(alert(document.cookie));]Float tag[/float]
[url=javascript:alert(document.cookie)]Click here to see cookie[/url]
[anchor=javascript:alert(document.cookie)]Anchor[/anchor]
[img]javascript:document.location='http://www.albinoblacksheep.com/flash/you.html'[/img]
[img]javascript:al&#x65rt('XSS')[/img]
http://host.com/?act=SR&f='><script>alert(document.cookie)</script>

[h3]Some broken tags[/h3]
We need to ensure that bad formating will not disrupt your site's HTML.

Broken [b]bold text...

[list]
[*]A broken list...

[quote]A broken quote...

File

bbcode-test.txt
View source
  1. 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.
  2. [h3]Normal text formatting:[/h3]
  3. Test [b]bold[/b] text
  4. Test [i]italic[/i] text
  5. Test [u]underlined[/u] text
  6. Test [s]strikeout[/s] text
  7. Test subscript text - H[sub]2[/sub]O
  8. Test superscript text - X[sup]3[/sup]
  9. [h3]Font colors:[/h3]
  10. Test [color=blue]blue[/color] text
  11. Test [color=red]red[/color] text
  12. Test [color=green]green[/color] text
  13. Test [color=#eeff00]#eeff00[/color] text
  14. [h3]Font sizes:[/h3]
  15. Test [size=1]1px[/size] - too small, normalized to 6px
  16. Test [size=12]12px[/size] text
  17. Test [size=24]24px[/size] text
  18. Test [size=100]100px[/size] - too big, normalized to 48px
  19. [h3]Font faces:[/h3]
  20. Test [font=arial]Arial typeface[/font] text
  21. Test [font=Arial Black]Arial typeface[/font] text
  22. Test [font=Courier]Courier typeface[/font] text
  23. Test [font=Courier New]Courier New typeface[/font] text
  24. Test [font=Impact]Impact typeface[/font] text
  25. Test [font=Helvetica]Helvetica typeface[/font] text
  26. Test [font=Times New Roman]Times New Roman typeface[/font] text
  27. Test [font=verdana]Verdana typeface[/font] text
  28. [h3]Text alignment:[/h3]
  29. [left]Left hand side of the screen[/left]
  30. [right]Right hand side of the screen[/right]
  31. [center]Centered[/center]
  32. [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]
  33. [h3]Images:[/h3]
  34. Normal image:
  35. [img]http://upload.wikimedia.org/wikipedia/en/0/0b/Drupallogo.png[/img]
  36. Float image right:
  37. [float=right][img]http://upload.wikimedia.org/wikipedia/en/0/0b/Drupallogo.png[/img][/float]
  38. Image with ALT description:
  39. [img=The Drupal Logo]http://upload.wikimedia.org/wikipedia/en/0/0b/Drupallogo.png[/img]
  40. Re-sized image:
  41. [img=100x50]http://upload.wikimedia.org/wikipedia/en/0/0b/Drupallogo.png[/img]
  42. [h3]Let's test some URLs:[/h3]
  43. www.test-url.com
  44. ftp.test-url.com
  45. http://test-url.com/~user/,part,of,url
  46. ftp://test-url.com:8080/
  47. [url]http://test-url.com/[/url]
  48. [url=http://test-url.com/?q=a+b&z=c]Test URL[/url]
  49. Anchor (bookmark you can link to):
  50. [anchor=TEST]URL Anchor[/anchor]
  51. 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.
  52. Google link: [google]BBCode[/google]
  53. Wikipedia link: [wikipedia]BBCode[/wikipedia]
  54. [h3]Let's test some E-mail addresses:[/h3]
  55. Test@Mail.com
  56. drupal.user@server1.drupal.org
  57. [email]joe@example.com[/email]
  58. [email=joe@smith.co.za]Joe Smith[/email]
  59. [h3]Test headings:[/h3]
  60. [h1]Level 1 Heading[/h1]
  61. [h2]Level 2 Heading[/h2]
  62. [h3]Level 3 Heading[/h3]
  63. [h4]Level 4 Heading[/h4]
  64. [h3]Test acronyms and abbreviations:[/h3]
  65. Abbreviations:
  66. [abbr=Application Programming Interface]API[/abbr]
  67. [abbr=Content Management System]CMS[/abbr]
  68. [abbr=World Wide Web]WWW[/abbr]
  69. Acronyms:
  70. [acronym=Structured Query Language]SQL[/acronym]
  71. [acronym=Graphics Interchange Format]GIF[/acronym]
  72. [acronym=Radio Detecting and Ranging]radar[/acronym]
  73. [h3]Code blocks:[/h3]
  74. Normal code block:
  75. [code]x := y + z;
  76. y := a - b;[/code]
  77. An [code]inline code[/code] block
  78. Color highlighted PHP code block:
  79. [php]
  80. echo "Sample PHP code";
  81. ?>
  82. [/php]
  83. Test notag:
  84. [notag]These BBCode tags are [b]not[/b] converted to HTML![/notag]
  85. [notag][size=20]I'm happy[/size][/notag]
  86. [h3]Quoting[/h3]
  87. A simple quote:
  88. [quote]This is a quoted message[/quote]
  89. Quote with source:
  90. [quote=Frank]This is a quoted message[/quote]
  91. Nested quotes:
  92. [quote=Gabor]This is a quoted message
  93. [quote=Alastair]This is a nested quote[/quote]
  94. [/quote]
  95. [h3]Lists[/h3]
  96. A normal list (circular bullets, same as list=c):
  97. [list]
  98. [*]x
  99. [*]y
  100. [*]z
  101. [/list]
  102. List with discs (list=d):
  103. [list=d]
  104. [*]x
  105. [*]y
  106. [*]z
  107. [/list]
  108. List with squares (list=s):
  109. [list=s]
  110. [*]x
  111. [*]y
  112. [*]z
  113. [/list]
  114. Numeric list (list=1):
  115. [list=1]
  116. [*]x
  117. [*]y
  118. [*]z
  119. [/list]
  120. Roman lowercase list (list=i):
  121. [list=i]
  122. [*]x
  123. [*]y
  124. [*]z
  125. [/list]
  126. Roman uppercase list (list=I):
  127. [list=I]
  128. [*]x
  129. [*]y
  130. [*]z
  131. [/list]
  132. Alfa lowercase list (list=a):
  133. [list=a]
  134. [*]x
  135. [*]y
  136. [*]z
  137. [/list]
  138. Alfa uppercase list (list=A):
  139. [list=A]
  140. [*]x
  141. [*]y
  142. [*]z
  143. [/list]
  144. A nested list:
  145. [list=s]
  146. [*]x
  147. [*][list=d]
  148. [*]x.1
  149. [*]x.2
  150. [/list]
  151. [*]y
  152. [*]z
  153. [/list]
  154. [h3]Table tags[/h3]
  155. [table]
  156. [row]
  157. [col]row1col1[/col]
  158. [col]row1col2[/col]
  159. [/row]
  160. [row]
  161. [col]row2col1[/col]
  162. [col]row2col2[/col]
  163. [/row]
  164. [/table]
  165. [table]
  166. [r]
  167. [c]row1col1[/c]
  168. [c]row1col2[/c]
  169. [/r]
  170. [r]
  171. [c]row2col1[/col]
  172. [c]row2col2[/col]
  173. [/r]
  174. [/table]
  175. [h3]Other tags[/h3]
  176. Test marquee:
  177. [move]Move tag - creates a scrolling display[/move]
  178. Horizontal delimiter:
  179. [hr]
  180. Force line break:
  181. -->[br]<--
  182. Force space:
  183. -->[sp]<--
  184. [h3]Test tag nesting:[/h3]
  185. [color=red][size=20]large red text[/size][/color]
  186. [size=20][color=red]again - large red test with different tag order[/color][/size]
  187. [h3]Test multi-line tags:[/h3]
  188. [size=20]
  189. [color=red]
  190. test
  191. [/color]
  192. [/size]
  193. [h3]Check for cross site scripting (XSS) vulnerabilities[/h3]
  194. User-entered text with embedded script tags will be encoded.
  195. Some other exploits:
  196. [size=expression(alert(document.cookie));]Size tag[/size]
  197. [font=expression(alert(document.cookie));]Font tag[/font]
  198. [float=expression(alert(document.cookie));]Float tag[/float]
  199. [url=javascript:alert(document.cookie)]Click here to see cookie[/url]
  200. [anchor=javascript:alert(document.cookie)]Anchor[/anchor]
  201. [img]javascript:document.location='http://www.albinoblacksheep.com/flash/you.html'[/img]
  202. [img]javascript:alert('XSS')[/img]
  203. http://host.com/?act=SR&f='>
  204. [h3]Some broken tags[/h3]
  205. We need to ensure that bad formating will not disrupt your site's HTML.
  206. Broken [b]bold text...
  207. [list]
  208. [*]A broken list...
  209. [quote]A broken quote...