Just sharing a method I learned to "escape" left and right square brackets in BBcode (the markup language used here on the forum) - that is, to insert BBcode tags into your post without having them interpreted as tags.
Most of the time you can use the
[code] tag, e.g.:
To insert a link use the url tag, for example:
[url=https://cnn.com]This is CNN[/url]
will produce the link: This is CNN
But what if you want to show how to use the
[code] tag? Using:
[code]
To format code in a post, use a [code] ... [/code] block.
[/code]
doesn't work because code blocks do not nest - the first end code tag will terminate the outer code block.
Or what if you want the tags to appear inline, e.g.
using [s]some text[/s] will make "some text" appear with a line through it, e.g. some text
The trick is to use a style tag to break-up the tag you want to insert literally, e.g. to insert
[TAG] use:
[color=black][TAG[/color][color=black]][/color]
Besides the
[color] tag other style tags will also work for this purpose, e.g.
[b],
[i],
[u],
[s],
[tt],
[font],
[size]. Of course, whatever style tag you use will affect the enclosed text.