Is there a way to escape bb tags in a post?

6StringJazzer

Well-known Member
Joined
Jan 27, 2010
Messages
1,121
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
I just saw a post where someone had posted code in code tags. That's wonderful. However, their VBA also had an evaluation of the named range "code" that they coded like this:

VBA Code:
[code]

Well that just threw the bb parser into a tizzy and a moderator had to add spaces for everything to format properly.

Isn't there a tag that says "stop parsing bb tags"? Or a way to escape a [ character? (On another forum I'm on there is a [noparse] tag that can be used for this but does not seem to work here.)
 

smozgur

BatCoder
Joined
Feb 28, 2002
Messages
1,591
[code] in the bb tags is already escaped. Just as you used in your post.
However, if there is a closing tag as well, which is [/code], or tags are misused (copy & paste, or some old imported posts), then it might still cause issues during the rendering. I believe the post you saw has an issue like this, so if you could let me know the link of the post then I can fix it manually as we've been doing regularly for the old posts.

There is also another option using tags in code tags, using the RICH option. Please see the following code snippet:

Rich (BB code):
This is a [code] tag with closing tag - [/code]

In this sample, the RICH option allows using other tags in the snippet. It is, however, still a problem using the [/code] tag because it is the closing tag and will first match during the render. To avoid this, and since I can use other tags with the RICH option, I used [plain] tag to wrap the code tags that will stop rendering the content of the wrapped section in the plain bb code. So, to make it more clear, the following shows the entire code that I used for the previous snipped. (please note that I had to use space for the inner plain bb code to make multiple embedded plain work properly for demonstration but it is not an actual use case)
Rich (BB code):
[code=rich]
This is a [plain][code][/ plain] tag with closing tag - [plain][/code][/ plain]
[/code]

And yes, you can always avoid bb code rendering by using a space character.

Hope this helps.
 
Learn Excel from Bill Jelen

Understanding data is crucial, and the easiest place to start is with Microsoft Excel.

Forum statistics

Threads
1,151,468
Messages
5,764,508
Members
425,219
Latest member
datdanigg

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top