# How to use bbCode tags as examples

**URL:** <https://boards.straightdope.com/t/how-to-use-bbcode-tags-as-examples/538493>\
**Category:** Factual Questions\
**Created:** [May 6, 2010, 8:26am UTC](https://boards.straightdope.com/t/how-to-use-bbcode-tags-as-examples/538493 "2010-05-06T08:26:50Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deflagration](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@Deflagration](https://boards.straightdope.com/u/Deflagration)\
**Post date:** [May 6, 2010, 8:26am UTC](https://boards.straightdope.com/t/how-to-use-bbcode-tags-as-examples/538493/1 "2010-05-06T08:26:50Z")

</div>

On a BB I frequent I have been asked to explain the bbCode tags.

I want to write a short guide for them. This will be posted as a sticky.

I want to write something like this:

> [@](#):
>
> To make something underline you need to use the tags.  
> So [u]Hello World[/u] becomes Hello World

But obviously without the code tags being broken (I added extra spaces in the text above).

I want to do the equivalent of escaping the escape sequence.

Thanks.

---

<div class="post-metadata">

**Author:** ![\_Undecided\_Adrian](https://avatars.discourse-cdn.com/v4/letter/_/eada6e/32.png) [@\_Undecided\_Adrian](https://boards.straightdope.com/u/_Undecided_Adrian)\
**Post date:** [May 6, 2010, 8:38am UTC](https://boards.straightdope.com/t/how-to-use-bbcode-tags-as-examples/538493/2 "2010-05-06T08:38:57Z")

</div>

You should be able to use the coded characters & #91; for left square bracket and & #93; for right square bracket. (Again, remove the spaces after the &.)

[http://www.w3.org/MarkUp/html-spec/html-spec\_13.html](http://www.w3.org/MarkUp/html-spec/html-spec_13.html)

---

<div class="post-metadata">

**Author:** ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)\
**Post date:** [May 6, 2010, 8:53am UTC](https://boards.straightdope.com/t/how-to-use-bbcode-tags-as-examples/538493/3 "2010-05-06T08:53:12Z")

</div>

[b\*\*] I think it can be done like this [/b\*\*]

---

<div class="post-metadata">

**Author:** ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)\
**Post date:** [May 6, 2010, 8:56am UTC](https://boards.straightdope.com/t/how-to-use-bbcode-tags-as-examples/538493/4 "2010-05-06T08:56:15Z")

</div>

That is: break the tag that you want to be shown by inserting another empty pair of tags within its brackets.

You want to show the bold tag, so you type this:

[b[i][/i]]

Which is rendered as this:

[b\*\*]

---

<div class="post-metadata">

**Author:** ![Deflagration](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@Deflagration](https://boards.straightdope.com/u/Deflagration)\
**Post date:** [May 6, 2010, 8:58am UTC](https://boards.straightdope.com/t/how-to-use-bbcode-tags-as-examples/538493/5 "2010-05-06T08:58:57Z")

</div>

Thanks **Mangetout** that works.

---

<div class="post-metadata">

**Author:** ![xash](https://avatars.discourse-cdn.com/v4/letter/x/c6cbf5/32.png) [@xash](https://boards.straightdope.com/u/xash)\
**Post date:** [May 6, 2010, 9:03am UTC](https://boards.straightdope.com/t/how-to-use-bbcode-tags-as-examples/538493/6 "2010-05-06T09:03:07Z")

</div>

Just use [noparse][noparse]text here[/noparse][/noparse].

e.g. [noparse]**this is an example of sentence inside a [noparse] tag, which should have been bold but isn’t**[/noparse].

Other examples:  
[noparse]_no italics_[/noparse]  
[noparse][www.google.com](http://www.google.com) [/noparse]  
[noparse]

> [@](#):
>
> that’s what she said

[/noparse]

---

<div class="post-metadata">

**Author:** ![Deflagration](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@Deflagration](https://boards.straightdope.com/u/Deflagration)\
**Post date:** [May 6, 2010, 9:19am UTC](https://boards.straightdope.com/t/how-to-use-bbcode-tags-as-examples/538493/7 "2010-05-06T09:19:37Z")

</div>

Just to update - on the board I’m using (phpbb based)

**Mangetout** ’s suggestion works for [​b] but not for [​img]. I guess this is because of the order they are interpreted.

Also once I do a preview post. All the empty [​i][/​i] tags are helpfully removed. Grr.

**xash’s** [​noparse] seems to not be implemented.

I finaly ‘fixed it’ using a zerowidthspace unicode U+200B within the tag to break it.

It also works here on the dope as I’ve used it whilst posting this reply.

---

<div class="post-metadata">

**Author:** ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)\
**Post date:** [May 6, 2010, 10:00am UTC](https://boards.straightdope.com/t/how-to-use-bbcode-tags-as-examples/538493/8 "2010-05-06T10:00:32Z")

</div>

> [@Deflagration](#):
>
> **Mangetout** ’s suggestion works for [​b] but not for [​img]. I guess this is because of the order they are interpreted.

:smack: Oh well.

Mind you… that does give me an interesting idea… a series of experimental posts should be able to determine the exact order in which vB tags are parsed on the SDMB. What I will do with such information is at present unclear.

---

<div class="post-metadata">

**Author:** ![Caught\_Work](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@Caught\_Work](https://boards.straightdope.com/u/Caught_Work)\
**Post date:** [May 6, 2010, 10:07am UTC](https://boards.straightdope.com/t/how-to-use-bbcode-tags-as-examples/538493/9 "2010-05-06T10:07:16Z")

</div>

Nefarious purposes ?

---

<div class="post-metadata">

**Author:** ![xash](https://avatars.discourse-cdn.com/v4/letter/x/c6cbf5/32.png) [@xash](https://boards.straightdope.com/u/xash)\
**Post date:** [May 6, 2010, 10:28am UTC](https://boards.straightdope.com/t/how-to-use-bbcode-tags-as-examples/538493/10 "2010-05-06T10:28:32Z")

</div>

> [@Mangetout](#):
>
> What I will do with such information is at present unclear.

You can proceed to eat it.

---

<div class="post-metadata">

**Author:** ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)\
**Post date:** [May 6, 2010, 10:47am UTC](https://boards.straightdope.com/t/how-to-use-bbcode-tags-as-examples/538493/11 "2010-05-06T10:47:11Z")

</div>

Actually, some of the tag order precendence is down to the browser (although only with intact tags) - as discussed in this thread:

> **[testing colours](https://boards.straightdope.com/sdmb/showthread.php?t=443169)**
>
> \[del\]red text with black strikethrough\[/del\] \[del\]red text with red strikethrough\[/del\] \[del\]\[COLOR=Black\]Black text with red strikethrough\[/del\]\[/COLOR\] \[del\]\[COLOR=Red\]red text with blue strikethrough\[/del\]\[/COLOR\] ...

---

<div class="post-metadata">

**Author:** ![Polycarp](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@Polycarp](https://boards.straightdope.com/u/Polycarp)\
**Post date:** [May 6, 2010, 2:50pm UTC](https://boards.straightdope.com/t/how-to-use-bbcode-tags-as-examples/538493/12 "2010-05-06T14:50:21Z")

</div>

I’m not familiar with phpbb’s characteristics, but most message board software includes the “code” tag for just this purpose – it sets a quote-like block within which coding is not parsed, so that one can show how to encode examples, which are usually then duplicated outside the code tag to show what effect they have.

Like this:

```auto

Use the **text to be bolded** tags to make a snippet of text bold.

```

Which becomes:

Use the **text to be bolded** tags to make a snippet of text bold.

ETA: Well, that was interesting. Any idea, **xash** , why it didn’t work?

---

<div class="post-metadata">

**Author:** ![Pasta](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pasta](https://boards.straightdope.com/u/Pasta)\
**Post date:** [May 6, 2010, 4:08pm UTC](https://boards.straightdope.com/t/how-to-use-bbcode-tags-as-examples/538493/13 "2010-05-06T16:08:16Z")

</div>

> [@Deflagration](#):
>
> I finaly ‘fixed it’ using a zerowidthspace unicode U+200B within the tag to break it.
> 
> It also works here on the dope as I’ve used it whilst posting this reply.

To me, your brackets appear to have a full-sized space in them. (Opera 10.10 on Windows Vista.) (It does look correct in IE 8.0.6 on my machine, though.)

---

<div class="post-metadata">

**Author:** ![xash](https://avatars.discourse-cdn.com/v4/letter/x/c6cbf5/32.png) [@xash](https://boards.straightdope.com/u/xash)\
**Post date:** [May 6, 2010, 7:40pm UTC](https://boards.straightdope.com/t/how-to-use-bbcode-tags-as-examples/538493/14 "2010-05-06T19:40:56Z")

</div>

> [@Polycarp](#):
>
> ETA: Well, that was interesting. Any idea, **xash** , why it didn’t work?

That’s not the purpose of the code tag.

The code tag is used for displaying programming code, and retains indentation and spaces, and uses a non-proportional font (great for ASCII art):

```auto

<?
$check = "test";
$check .= $filename;
if ($test == $check)
{
print("<HTML><BODY>You have already voted. Thank you.</BODY></HTML>");
}
else
{
$rated = "test";
$rated .= $filename;
setcookie(test, $rated, time()+86400);
print("<HTML><BODY><br>You haven't voted before so I recorded your vote</BODY></HTML>");
}
?>

```

or the php tag:

```php

<?
$check = "test";
$check .= $filename;
if ($test == $check)
{
print("<HTML><BODY>You have already voted. Thank you.</BODY></HTML>");
}
else
{
$rated = "test";
$rated .= $filename;
setcookie(test, $rated, time()+86400);
print("<HTML><BODY><br>You haven't voted before so I recorded your vote</BODY></HTML>");
}
?>

```

**Deflagration** , maybe this will help you. It explains each code, with examples:

[http://www.vbulletin.com/forum/misc.php?do=bbcode](http://www.vbulletin.com/forum/misc.php?do=bbcode)
