BBCode: Difference between revisions
Miqrogroove (talk | contribs) No edit summary |
Miqrogroove (talk | contribs) |
||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
BBCode is an abbreviation for Bulletin Board Code. BBCode is essentially a series of tags that can be used to style or format text in posts. Examples of BBCode's uses are centered text, lists, varying font sizes and colors in posts. | BBCode is an abbreviation for ''Bulletin Board Code''. BBCode is essentially a series of tags that can be used to style or format text in posts. Examples of BBCode's uses are centered text, lists, varying font sizes and colors in posts. | ||
==The Basics== | ==The Basics== | ||
To use | To use BBCode you first need to know what the effect is you're trying to reach. For example, we want, in the following text: | ||
{{highlight | These few words in this text should be bold, while these should not}} | {{highlight | These few words in this text should be bold, while these should not}} | ||
| Line 14: | Line 14: | ||
{{highlight | '''These few words in this text should be bold''', while these should not}} | {{highlight | '''These few words in this text should be bold''', while these should not}} | ||
A few basic rules for all | A few basic rules for all BBCode: | ||
*all | *all BBCode must be closed, so having [a] means we also need to have [/a] which "closes" it. The only exception to this is when using [*] | ||
*although some bbcode can be used in a case-insensitive way (ie. you can use both [img][/img] and [IMG][/IMG], this is not guaranteed to work in all cases. To be on the safe side, try using it in lower-case if you can (ie. [b][/b] instead of [B][B]) to minimize processing time required to transform these to HTML. | *although some bbcode can be used in a case-insensitive way (ie. you can use both [img][/img] and [IMG][/IMG], this is not guaranteed to work in all cases. To be on the safe side, try using it in lower-case if you can (ie. [b][/b] instead of [B][B]) to minimize processing time required to transform these to HTML. | ||
==Text Formatting== | ==Text Formatting== | ||
<table | <table class="wikitable"> | ||
<tr> | <tr> | ||
<th | <th>Opening Tag</th> | ||
<th>Closing Tag</th> | |||
<th>Effect</th> | |||
<th>Additional Information</th> | |||
</tr> | |||
</ | |||
<tr> | |||
<td> | |||
[b] | |||
</td> | |||
<td> | |||
[/b] | |||
</td> | |||
<td> | |||
<b>Makes the enclosed text bold.</b> | |||
</td> | |||
<td> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td> | |||
[i] | |||
</td> | |||
<td> | |||
[/i] | |||
</td> | |||
<td> | |||
<i>Makes the enclosed text italic</i> | |||
</td> | |||
<td> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td> | |||
[u] | |||
</td> | |||
<td> | |||
[/u] | |||
</td> | |||
<td> | |||
<u>Makes the enclosed text underlined.</u> | |||
</td> | |||
<td> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td> | |||
[strike] | |||
</td> | |||
<td> | |||
[/strike] | |||
</td> | |||
<td> | |||
<strike>Strikes the enclosed text.</strike> | |||
</td> | |||
<td> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td> | |||
[blink] | |||
</td> | |||
<td> | |||
[/blink] | |||
</td> | |||
<td> | |||
<span class="blink">Makes the enclosed text blink.</span> | |||
</td> | |||
<td> | |||
This tag may not work on modern browsers in versions below XMB 1.10.x.<hr /> | |||
The re-implementation of this tag may not reflect exactly the original behaviour. | |||
</td> | |||
</tr> | |||
<tr> | |||
<td> | |||
[marquee] | |||
</td> | |||
<td> | |||
[/marquee] | |||
</td> | |||
<td> | |||
<div class="marquee"><div class="marquee2">Makes the enclosed text scroll -right to left.</div></div> | |||
</td> | |||
<td> | |||
This tag may not work on modern browsers in versions below XMB 1.10.x.<hr /> | |||
The re-implementation of this tag may not reflect exactly the original behaviour. | |||
</td> | |||
</tr> | |||
<tr> | |||
<td> | |||
[color=<b>X</b>] | |||
</td> | |||
<td> | |||
[/color] | |||
</td> | |||
<td> | |||
Changes the enclosed text color to <b>X</b>. | |||
</td> | |||
<td> | |||
<b>X</b> may be a hexadecimal RGB value (#000000 - #FFFFFF), rgb(0,0,0) - rgb(128,128,128), or any other standard CSS color value (Red, Green, etc).<hr /> | |||
As of XMB 1.10, the W3C Extended Color Set is supported. | |||
</td> | |||
</tr> | |||
<tr> | |||
<td> | |||
[size=<b>X</b>] | |||
</td> | |||
<td> | |||
[/size] | |||
</td> | |||
<td> | |||
Changes the size of the enclosed text to <b>X</b>. | |||
</td> | |||
<td> | |||
<b>X</b> is an offset form base-font-size. For example: If the forum font is set to 10pt, [size=]text[/size] will show "text" in 15pt font size. Size range can be set from -10 to 99. | |||
</td> | |||
</tr> | |||
<tr> | |||
<td> | |||
[font=<b>X</b>] | |||
</td> | |||
<td> | |||
[/font] | |||
</td> | |||
<td> | |||
Changes the font of the enclosed text to <b>X</b>. | |||
</td> | |||
<td> | |||
<b>X</b> can be any font, including generic fallbacks.<hr /> | |||
Prior to XMB 1.9.12.09, fonts with a "-" symbol could not be used. | |||
</td> | |||
</tr> | |||
<tr> | |||
<td> | |||
[align=<b>X</b>] | |||
</td> | |||
<td> | |||
[/align] | |||
</td> | |||
<td> | |||
Aligns the enclosed text to <b>X</b>. | |||
</td> | |||
<td> | |||
<b>X</b> can be any <b>one</b> of the following: left, center, right, or justify. | |||
</td> | |||
</tr> | |||
</table> | |||
<!-- I'm sorry for this one's formatting, I really am --> | |||
==Text Structure== | ==Text Structure== | ||
<table class="wikitable"> | <table class="wikitable"> | ||
<tr> | <tr> | ||
<th | <th>Opening Tag</th> | ||
</th></tr> | <th>Closing Tag</th> | ||
<tr> | <th>Effect</th> | ||
<td> [quote] </td><td> [/quote] </td><td> <table style="border: 1px solid # | <th>Additional Information</th> | ||
< | </tr> | ||
<tr> | |||
<td> | |||
< | [quote] | ||
</td> | |||
<td> | |||
[/quote] | |||
</td> | |||
<td> | |||
<table align="center" class="quote" cellspacing="0" cellpadding="0" style="border:1px solid #86a9b6;margin: 15px 5% 10px 5%;width: 80%;"><tr><td class="quote" style="background-color: #d3dfe4;border-bottom: 1px solid #86a9b6;color: #24404b;font-family: Tahoma, Arial, Helvetica, Verdana;font-size: 11px;font-weight: bold;height: 20px;padding-left: 5px;">Quote:</td></tr><tr><td class="quotemessage" style="background-color: #f4f7f8;color: #000000;font-family: Tahoma, Arial, Helvetica, Verdana;font-size: 11px;padding: 10px 0 20px 5px;">text </td></tr></table> | |||
</td> | |||
<td> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td> | |||
[rquote=<b>X</b>​&tid=<b>Y</b>​&author=<b>Z</b>] | |||
</td> | |||
<td> | |||
[/rquote] | |||
</td> | |||
<td> | |||
<table align="center" class="quote" cellspacing="0" cellpadding="0" style="border:1px solid #86a9b6;margin: 15px 5% 10px 5%;width: 80%;"><tr><td class="quote" style="background-color: #d3dfe4;border-bottom: 1px solid #86a9b6;color: #24404b;font-family: Tahoma, Arial, Helvetica, Verdana;font-size: 11px;font-weight: bold;height: 20px;padding-left: 5px;">Quote: [https://forums.xmbforum2.com/viewthread.php?tid=777162&goto=search&pid=1376512 Originally posted by flushedpancake]</td></tr><tr><td class="quotemessage" style="background-color: #f4f7f8;color: #000000;font-family: Tahoma, Arial, Helvetica, Verdana;font-size: 11px;padding: 10px 0 20px 5px;">text </td></tr></table> | |||
</td> | |||
<td> | |||
When a quote is generated by XMB, the first line usually contains the author of the quoted post: [i]Originally posted by EXAMPLE:[/i] | |||
</td> | |||
</tr> | |||
<tr> | |||
<td> | |||
[code] | |||
</td> | |||
<td> | |||
[/code] | |||
</td> | |||
<td> | |||
<table align="center" class="code" cellspacing="0" cellpadding="0" style="border: 1px solid #86a9b6;margin: 15px auto 10px auto;"><tr><td class="code" style="background-color: #d3dfe4;border-bottom: 1px solid #86a9b6;color: #24404b;font-family: Tahoma, Arial, Helvetica, Verdana;font-size: 11px;font-weight: bold;height: 20px;padding-left: 5px;">Code:</td></tr><tr><td class="codemessage" style="background-color: #f4f7f8;color: #000000;font-size: 11px;padding: 10px 5px 10px 5px;white-space: pre;display: block;width: 600px;max-height: 400px;overflow: auto;border: none;"><span style="font-family:monospace;">while(true) | |||
printf("Hello World!");</span></td></tr></table> | |||
</td> | |||
<td> | |||
Text enclosed in <code>[code][/code]</code> BBCode will preserve whitespace and will be shown in monotype font (so all characters have the same width and height). Smilies and other BBCode will not be parsed inside <code>[code][/code]</code> tags. | |||
</td> | |||
</tr> | |||
</table> | |||
==Block Elements== | ==Block Elements== | ||
<table class="wikitable"> | <table class="wikitable"> | ||
<tr> | <tr> | ||
<th | <th>Opening Tag</th> | ||
</th | <th>Closing Tag</th> | ||
<th>Effect</th> | |||
<th>Additional Information</th> | |||
</tr> | |||
< | <tr> | ||
< | <td> | ||
[img] | |||
</td> | |||
<td> | |||
[/img]</td> | |||
<td> | |||
[content is replaced with the image] | |||
</td> | |||
<td> | |||
</td></tr> | </td> | ||
<tr> | </tr> | ||
<td> [ | <tr> | ||
</td></tr> | <td> | ||
<tr> | [img=AxB] | ||
<td> [ | </td> | ||
<td> | |||
[/img] | |||
</td> | |||
<td> | |||
[content is replaced with the image, resized to AxB px] | |||
</td> | |||
<td> | |||
As of XMB 1.9.12.09, no support for percentage-based resizing exists. | |||
</td> | |||
</tr> | |||
<tr> | |||
<td> | |||
[url]</td> | |||
<td> | |||
[/url] | |||
</td> | |||
<td> | |||
Standard URL | |||
</td> | |||
<td> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td> | |||
[url=<b>X</b>] | |||
</td> | |||
<td> | |||
[url] | |||
<td> | |||
[http://forums.xmbforum2.com Labelled URL] | |||
</td> | |||
<td> | |||
</td></tr> | </td> | ||
<tr> | </tr> | ||
<td> [email | <tr> | ||
< | <td> | ||
[email] | |||
</td> | |||
<td> | |||
[/email] | |||
</td> | |||
<td> | |||
[mailto:postmaster@qaop.gb mailto email link] | |||
</td> | |||
<td> | |||
</td> | |||
</tr> | |||
<tr> | |||
<td> | |||
[email=<b>X</b>] | |||
</td> | |||
<td> | |||
[/email] | |||
</td> | |||
<td> | |||
[mailto:postmaster@qaop.gb Labelled email mailto link] | |||
<td> | |||
[list] Text Here [/list] | </td> | ||
</tr> | |||
<tr> | |||
<td> | |||
[youtube?] | |||
</td> | |||
<td> | |||
[/youtube?] | |||
</td> | |||
<td> | |||
[YouTube embed] | |||
</td> | |||
<td> | |||
Since 1.9.12.07, the tag supports raw video IDs, youtu.be, youtube.com and m.youtube.com URLs. | |||
</td> | |||
</tr> | |||
<tr> | |||
<td> | |||
[list] Text Here | |||
</td> | |||
<td> | |||
[/list] | |||
</td> | |||
<td> | |||
This will create a list from the text, in bullet points. | |||
</td> | |||
<td> | |||
list can also take one of the following arguments:<br><b>List Items</b>[list=1]<br>[list=a]<br>[list=A]<br><br>[*] Text - When [*] is placed in a list, it will provide a bullet in front of the text. | |||
</td> | |||
</tr> | |||
</table> | |||
Latest revision as of 11:26, 2 July 2025
BBCode is an abbreviation for Bulletin Board Code. BBCode is essentially a series of tags that can be used to style or format text in posts. Examples of BBCode's uses are centered text, lists, varying font sizes and colors in posts.
The Basics
To use BBCode you first need to know what the effect is you're trying to reach. For example, we want, in the following text:
These few words in this text should be bold, while these should not
to have bold words. Looking at the table below, we can see that the bbcode to make text bold is
[b]bold text[/b]
Thus, having the following text:
[b]These few words in this text should be bold[/b], while these should not
will make the text look like this:
These few words in this text should be bold, while these should not
A few basic rules for all BBCode:
- all BBCode must be closed, so having [a] means we also need to have [/a] which "closes" it. The only exception to this is when using [*]
- although some bbcode can be used in a case-insensitive way (ie. you can use both [img][/img] and [IMG][/IMG], this is not guaranteed to work in all cases. To be on the safe side, try using it in lower-case if you can (ie. [b][/b] instead of [B][B]) to minimize processing time required to transform these to HTML.
Text Formatting
| Opening Tag | Closing Tag | Effect | Additional Information |
|---|---|---|---|
|
[b] |
[/b] |
Makes the enclosed text bold. |
|
|
[i] |
[/i] |
Makes the enclosed text italic |
|
|
[u] |
[/u] |
Makes the enclosed text underlined. |
|
|
[strike] |
[/strike] |
|
|
|
[blink] |
[/blink] |
Makes the enclosed text blink. |
This tag may not work on modern browsers in versions below XMB 1.10.x. The re-implementation of this tag may not reflect exactly the original behaviour. |
|
[marquee] |
[/marquee] |
Makes the enclosed text scroll -right to left. |
This tag may not work on modern browsers in versions below XMB 1.10.x. The re-implementation of this tag may not reflect exactly the original behaviour. |
|
[color=X] |
[/color] |
Changes the enclosed text color to X. |
X may be a hexadecimal RGB value (#000000 - #FFFFFF), rgb(0,0,0) - rgb(128,128,128), or any other standard CSS color value (Red, Green, etc). As of XMB 1.10, the W3C Extended Color Set is supported. |
|
[size=X] |
[/size] |
Changes the size of the enclosed text to X. |
X is an offset form base-font-size. For example: If the forum font is set to 10pt, [size=]text[/size] will show "text" in 15pt font size. Size range can be set from -10 to 99. |
|
[font=X] |
[/font] |
Changes the font of the enclosed text to X. |
X can be any font, including generic fallbacks. Prior to XMB 1.9.12.09, fonts with a "-" symbol could not be used. |
|
[align=X] |
[/align] |
Aligns the enclosed text to X. |
X can be any one of the following: left, center, right, or justify. |
Text Structure
| Opening Tag | Closing Tag | Effect | Additional Information | |
|---|---|---|---|---|
|
[quote] |
[/quote] |
|
||
|
[rquote=X&tid=Y&author=Z] |
[/rquote] |
|
When a quote is generated by XMB, the first line usually contains the author of the quoted post: [i]Originally posted by EXAMPLE:[/i] |
|
|
[code] |
[/code] |
|
Text enclosed in |
Block Elements
| Opening Tag | Closing Tag | Effect | Additional Information |
|---|---|---|---|
|
[img] |
[/img] |
[content is replaced with the image] |
|
|
[img=AxB] |
[/img] |
[content is replaced with the image, resized to AxB px] |
As of XMB 1.9.12.09, no support for percentage-based resizing exists. |
| [url] |
[/url] |
Standard URL |
|
|
[url=X] |
[url] | ||
|
[email] |
[/email] |
||
|
[email=X] |
[/email] |
||
|
[youtube?] |
[/youtube?] |
[YouTube embed] |
Since 1.9.12.07, the tag supports raw video IDs, youtu.be, youtube.com and m.youtube.com URLs. |
|
[list] Text Here |
[/list] |
This will create a list from the text, in bullet points. |
list can also take one of the following arguments: |