Best Course of Action on Supporting Custom BBCode?

Hi all,

We are definitely looking at Discourse as an alternative to our forum software for a varity of reasons but one of the big things we have to figure out is what to do with all the bbcode we support on our site which can be seen here: Tutorial - RpNation - BBcode Guide | RpNation and here: Tutorial - RpNation - BBCode+ Guide | RpNation

Looking at the vbulletin bbcode plugin as a reference, it doesn’t seem like it will be too difficult to just add in support for what we already do. We have all sorts of custom bbcode as seen in the guides, from simple things to a custom div bbcode that lets people essentially use HTML to an extent in a secure manner that generates a custom id selector for the post and users can’t target anything outside of the post container.

This has allowed people to create some really fantastic posts over the years, here is a quick example I found by just glancing around:

I guess my question is, should we make this a bbcode plugin, or attempt to create a safe method where we can keep HTML selectors contained in posts like we do for our BBCode and investigate that method and offer that instead?

Though I shudder at the idea of letting people use HTML

We want to keep users the ability to continue to format their posts while also making sure that everything stays safe.

1 Like

I can see why you are looking into a new software, loading Tutorial - RpNation - BBcode Guide | RpNation is taking 2 minutes for me :scream:

I believe all your custom styles, like newspaper, challenge, sides, can be done with Generic bbcode wrapper for theme components and CSS.

And lots of it are built-in in Discourse, like code highlight, super/sub script, center block, tables, blockquotes, inline spoilers, dividers, headers, media embed, etc.


Oh noes. That sounds gross. We are running Cloudflare + a decently beefy AMD Ryzen server. Takes about 2 seconds for me to load all assets logged out.

Definitely looking at this. So essentially we can add any HTML/CSS in a theme component and then call it using a custom bbcode tag?

So, in this case, we could recreate some of our stuff with:

[wrap=bg bg=blue] or [wrap=random-name newspaper=1]

It might still be for the best that maybe we use something like the Plugin’s format so that a ton of content does not lose formating. Also multi optional arguments.


You might have a look at Discourse BBCode. I think it should be relatively easy to add support for other codes (though, TBH, I had trouble figuring out how to do it. . . )


Could you not have put that whole guide into one Post and made it a Wiki when you felt like adding more? Having it in multiple posts makes it much harder to read and comprehend imho and creates a lot of wasted space.

1 Like

que genial, me encanta mucho

Also note that Discourse out-of-the-box supports some restricted HTML anywhere in the post content, not just inside a special wrapper. For example, this post is wrapped inside a <div align=justify>. Unfortunately it does mess with some of the inline formatting, forcing HTML for everything in the paragraph.

1 Like

That bbcode guide is in a different forum software, one that doesn’t have wiki posts.

Awesome. Though I think we’d rather keep it as bbcode that we add in via extending that one plugin then rather finding a way to give everyone more html that we have to make safe.


We found the official Discourse BBCode plugin more difficult to modify (because of our low discourse plugin developer skills) than this one:

Awesome BBCodes Plugin

Awesome BBCodes Plugin: multi-paragraph, nestable, with auto-complete

The " Awesome BBCodes Plugin" was quite easy to fork, clone and hack / modify; much easier than the “Discourse BBCode” plugin.

My suggestion is to anyone ( @TheDarkWizard ) looking to create custom BBCODE is to start with the " Awesome BBCodes Plugin" and hack away from there.


Aha apologies, yeah, all the more reason to migrate! :slight_smile:

No problem :slight_smile:

Will take a look at it. Thank you!

1 Like