MyBB Community Forums

Full Version: bbCode Parsing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'd like to take issue a bit with MyBB's bbcode. vB's works sooooo much better. It's really easy to break the code with MyBB, such as this:

This color is red but this word is blue.

Now, that should actually show up as a red sentence, with the word 'blue' being Navy. But it doesn't. vB can automatically do this, and I think it'd be a good feature for MyBB too. I have a forum signature generator on my site, but I had to code a completely different kind for MyBB, because you have to close a tag before you use the same sort of tag again, so that it works correctly.

It's just kind of annoying ;< Understand what I'm saying? Kind of confusing.
I think this is mostly an issue with preg_replace() function.

MyBB does that kind of nested parsing with quotes for example, however, if you started doing that with every bbCode, I think it'd make the parser a _lot_ slower...

Nice idea, but speed is also a consideration...
Yes, it would have a dramatic effect on speed
[color="#6456A2"]I thought this already worked [/color]
Obviously it doesn't.
blueparukia Wrote:I thought this already worked
Obviously it doesn't.

Fixed for you
Some forum systems require quotes to be surrounded with properties. Why? Don't ask me, I think it's ludicrous.

I mean, why are users forced to enter more?
[quote="someone"]blah[/quote]

etc...

Though I probably would add a thing to the parser to allow quotes to be entered, so people copy+pasting from those other sites won't have to manually remove the quotes.
Not sure, but IIRC the regex would be something similar:
\[color=(\'?|\"?)([a-zA-Z]*|\#?[0-9a-fA-F]{6})(\'?|\"?)\](.*?)\[/color\]
It wouldn't have that much of an effect on speed. Look at any vB or IPB forum~
PHP_Paul Wrote:It wouldn't have that much of an effect on speed. Look at any vB or IPB forum~

That's because they pre-parse. We parse on-the-fly. Also, if you bench mark any editing feature on vB or IPB it will be slower than MyBB's since it has to unconvert
They pre-parse? Wow. I wonder how adding a custom code would affect the forum.

I'm interested because I pre-parse on my board to reduce the load away from the parser. Issue is that posts are stored twice, but I'm just wondering how it'd be possible to add a new bbCode without having to reparse all the posts...
They only pre-parse some things
Pages: 1 2