Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved [How To?] Escape square brackets in bbCode
#1
Not Solved
I am trying to explain a little about how to write bbCode in one of my posts and bumped into the problem that I couldn't find any info on how to escape the square brackets so they don't get interpreted/converted by the bbCode parser.

For example, I'd like to tell them "To start a quote, first type [quote] and then type [/qoute]" (-> I misspelled the second quote deliberately in order to avoid generating a "real" quote in the post).

Is there any way to do this, without having to misspell the quotes?
#2
Not Solved
Put it in [code] tags.
#3
Not Solved
(2012-08-03, 02:36 AM)brad-t Wrote: Put it in [ code] tags.

Then, I'd tell them "To start a quote, first type
[quote]
and then type
[/quote]
"... which looks really awful IMHO because it breaks the natural flow of reading.

That actually brings me to another question with bbCode: is there a way to do inline code to generate something like <code>this</code> without that big Code box? I think stackoverflow has a really nice way of dealing with this, in that it allows the user to choose between both - inline and boxed...

...the more I think of it, it seems like I have to mess with the bbCode parser, or can I get around this with custom bbCodes? The inline code thing should be possible IMO, but for correct non-interpretation of quoted bbCode [tags]?
#4
Not Solved
Another solution:
Type like this:
[b][[/b]IMG[b]][/b] [b][[/b]/IMG[b]][/b]

It will appear this way:
[IMG] [/IMG]

For the boxes, don't mess with parsers. Simply modify the styles of blockquote and codeblock in your global.css as per your choice.
#5
Not Solved
Thanks for that idea, it is great! That also could be the basis for a custom MyCode which doesn't change the formatting (as in your case to bold) but can just be used to escape the square brackets... I'll give it a try.
#6
Not Solved
Well, the sane way to explain it would be to write:

[quote]Quoted message here[/quote]

Or you can make a new mycode that wraps in <pre> tags.
#7
Not Solved
(2012-08-03, 02:50 AM)FriendFX Wrote: That actually brings me to another question with bbCode: is there a way to do inline code to generate something like <code>this</code> without that big Code box? I think stackoverflow has a really nice way of dealing with this, in that it allows the user to choose between both - inline and boxed...


i created a custom MyCode to do this.
see here:
http://community.mybb.com/thread-133376.html
#8
Not Solved
That just changes how the text is displayed. What happens if I type [c][quote]examplecode[/quote][/c]? To get it to not parse, you'd have to override the parser with either a plugin or a code edit.
Please don't PM me for support. Smile
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)