Hi Meta, we are back. Let's talk about Markdown-it and BBcode

Disclaimer: I know that trying to shove BBCode back into Discourse is unconventional but its one of the few things stopping us from completely moving to Discourse and I’ve seen some really large sites (not many) use custom bbcode to a degree. Any help would be appreciated.

Hey All,

After taking a year off from our testing, the bulk import tests have resumed. We can do 30 million messages (this includes PMs), users, avatars and such in under a few hours. Attachments still make it take a week but nothing is perfect.

One of the last things we worked on last time was our bbcode suite which is located here: Tutorial - RpNation - BBcode Guide | RpNation (that link is our live site on xenforo and all those codes were made by us for our community).

We mostly got them working on Discourse here: GitHub - RpNation/discourse-rpn-bbcode

But we had issues with inline bbcodes inside of block codes:

[block][inline]text[/inline]
text
[/block]

To get around this we have an inelegant branch Refactor/TextPostProcss that runs a regex replacement after the bbcode parse.

I wanted to know if anyone had any ideas on how improve what we are doing within the confines of Markdown-it and discourse. We were thinking of possibly just using an entirely new bbcode parser at some point as an option as well.

For those of you curious, here’s the kind of stuff that some of our users have made with bbcodes on xenforo: Resource - πšŒπšŠπš—πšπš’ πšœπš”πš’πšŽπšœ: πšπš‘πšŽ 𝚜𝚠𝚎𝚎𝚝 πšπšŠπšŒπšπš˜πš›πš’! | RpNation

It mostly works on Discourse now after our new branch but we haven’t setup a Discourse demo for bbcode yet. (Going to be focusing on the bulk importer and styling first before we return our attention to bbcode as a whole again).

Credit to @Alteras for leading the way on our bbcode project last year. @Ghan as well, though he’s leading the efforts primarily on the bulk importer, I’m just a styling monkey and the guy who owns the site.

1 Like

Can’t say I understand all you said, but maybe this information could interest you?

Unfortunately not, but we already have some leads!

I wonder if moving from bbcode to html custom elements would make it easier. Would this be feasible?

That is something we’ve definitely thought about and desired in the past, I was not aware that we could extend and whitelist the existing suite of allowed html. We do have a workaround for the issue already but it’s a regex that runs clientside to fix any remaining tag issues.

Any documentation or examples you could point us at?

1 Like
2 Likes