You are here

bbcode-test.txt in Bbcode 7

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

[index]
[hr]

[h3]Normal text formatting[/h3]
Test [b]bold[/b] / [strong]strong[/strong] text
Test [i]italic[/i] / [em]emphasised[/em] 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
[size=10] $_SERVER[PHP_SELF] "quoted" \\e\s\c\aped\" [/size] - watch out for eval

[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/commons/7/7c/Drupal.ru-Logo.png[/img]

Align image right:
[img align=right]http://upload.wikimedia.org/wikipedia/commons/7/7c/Drupal.ru-Logo.png[/img]

Image with ALT description:
[img=The Drupal Logo]http://upload.wikimedia.org/wikipedia/commons/7/7c/Drupal.ru-Logo.png[/img]

Re-sized image:
[img=100x50]http://upload.wikimedia.org/wikipedia/commons/7/7c/Drupal.ru-Logo.png[/img]

[h3]URL's[/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]
Youtube video: [youtube]0Q2aPi9ZEgs[/youtube]

[h3]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]Headings[/h3]
[h1]Level 1 Heading[/h1]
[h2]Level 2 Heading[/h2]
[h3]Level 3 Heading[/h3]
[h4]Level 4 Heading[/h4]

[h3]Acronyms and abbreviations[/h3]
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]

[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][*]foo[*]bar[*]baz[/list]

List with circular buttets (list=c):
[list=c]
[*]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]

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

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

Simple nested lists:
[list][*]foo[list][*]bar[/list][*]baz[/list]

Complex nested list:
[list=1]
  [*]list=foo
    [list=s]
      [*]list=s
      [*]list=s
    [/list]
    [list=a]
      [*]list=a
        [list=I]
          [*]list=I
          [*]list=I
        [/list]
      [*]list=a
    [/list]
  [*]list=bar
    [list=A]
      [*]list=A
      [*]list=A
      [*]list=A
    [/list]
  [*]list=baz
    [list=d]
      [*]list=d
      [*]list=d
    [/list]
[/list]

List with php content (watch out for eval):
[list][*] {$var $_SERVER[PHP_SELF] "quoted" \\e\s\c\aped\" [/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 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]

[h3]Other tags[/h3]

Horizontal delimiter:
[hr]

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

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

[h3]Tag nesting[/h3]
[size=10]10px [size=20]20px [size=30]30px [/size]20px [/size]10px[/size]
[size=20][color=blue]BLUE [color=red]RED [/color][color=green]GREEN [/color]BLUE[/color] [/size]
[size=20][font=Arial]Arial [font=Century]Century [/font][font=Comic sans MS]Comic sans MS [/font]Arial [font=Arial Bold Italic]Arial Bold Italic [/font]Arial [/font][/size]

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

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