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