MyBB Community Forums

Full Version: Nested [code] tags...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
http://community.mybb.com/thread-140354.html

I'm having an issue where if I try 'nesting' code tags, ... basically putting [code] within a [code] tag and have the inner-most pair of code tags ignored. Is there a possibility of having this fixed? Whether it be through manual edits somewhere or a plugin...

I've managed to reproduce the problem here on this board as well.
just wondering - why one needs nested code blocks!
(2013-06-03, 12:59 PM).m. Wrote: [ -> ]just wondering - why one needs nested code blocks!

I'm not specifically asking for code blocks within code blocks, I'm just asking for a fix to have it choose the outer-most code tags, and codify-it-all inside, ignoring the 'nested' one.

The forum I am running has an extremely specific purpose, and we use the [code] mycode quite extensively to facilitate the ability to copy/paste mycode snippets. Some of these snippets would contain their own [code] blocks within, and I'd rather not have them bug out as seen in the testing thread I've created here. I'd simply like the [code] function locate the last closing code tag instead of the first, as it is now.

Edit, did a bit more searching, and based on what I read about regular expressions, ... is there a way to change the regular expression searching for [code] blocks from ungreedy (what we have now) to being greedy (what would produce the effect I want)? I'm currently trying something in class_parser.php, and not having a lick of luck with it..

edit2, found a way to make it greedy, ... but this causes a new problem. ... now if I intend to use multiple code blocks in the same post, its impossible to do. .... so I'm guessing a rewrite of how mybb handles code tags is needed... ...