Improved bbcode

Posted by aeron on Jan. 25, 2014, 10:09 p.m.

JoshDreamland was nice enough to write us a brand new bbcode parser to replace our old (and very messy) parser. Generally you won't notice much difference as the changes are mostly behind the scenes, but the real benefit is for the developers. It is now incredibly easy to add new tags of all shapes and sizes and arbitrary functionality, as everything is uniformly organized.

So, I've finished porting all our old tags over, and everything should behave about the same as it did before.


Section Edited:

I rewrote the tag help page such that it is always up to date with the supported tags. Take a look!

I had also updated the youtube code to the modern embed tag, which has fixed some bugs with fullscreen. However, the new style of embedding seems to slow down loading, even behind hide tags. It is up for debate whether or not we should go back to the purely flash based embed.


Last but not least: A brand new tag for… you guessed it FSX: Markdown!

Markdown
[markdown]
# Headers and *stuff*
[A link](/index.php)
 * Also, lists
 * Lists are very useful
   * These are easy to write too
 * Have another

# Using reference links
I get 10 times more traffic from [Google] [1] than from [Yahoo] [2] or [MSN] [3].

  [1]: <a rel="nofollow" href="http://google.com/">http://google.com/</a>
  [2]: <a rel="nofollow" href="http://search.yahoo.com/">http://search.yahoo.com/</a>
  [3]: <a rel="nofollow" href="http://search.msn.com/">http://search.msn.com/</a>
[/markdown]

Quote: Result

Headers and stuff

A link * Also, lists * Lists are very useful * These are easy to write too * Have another

Using reference links

I get 10 times more traffic from [Google] [1] than from [Yahoo] [2] or [MSN] [3].

[1]: http://google.com/ [2]: http://search.yahoo.com/ [3]: http://search.msn.com/

That tag is also aliased to [md[blk]].

So yeah, let me know if you find any site-breaking bugs over the next few days due to this change and I'll look into it ASAP. And if you have suggestions for new (useful) tags, I'm all ears.

Comments

melee-master 10 years, 3 months ago

I'm pretty sure some of the old bbcode parser was among the first PHP I ever wrote… hahaha. Fuck that was a long time ago now.

eagly 10 years, 3 months ago

Your avatar had me watching for the 45 minute train journey to work. It's like a tv show!

sirxemic 10 years, 3 months ago

But other than that, great job :D

Also liking the fact that my music is used on the bbcode page :3

firestormx 10 years, 3 months ago

I'm so happy that markdown users are forced to use a BBCode tag. :3

Markdown makes some things nicer to type (lists especially), but that's about it.

Thanks Josh. :D

Toast 10 years, 3 months ago

[flash width=320 height=240]http://files.64digits.com/Toast/MyApplication.swf[/flash]

I didn't know there was a flash tag

aeron 10 years, 3 months ago

Added the easy list tag:

[list]
[*]One
[*]Two
[@]Three
[/list]

[list]
[o]Four
[O]Five
[0]Six
[/list]

[list]
[+]Seven
[x]Eight
[#]Nine
[/list]

Quote:
  • One
  • Two[@]Three
    FourFive[0]Six
    [+]Seven[x]Eight[#]Nine

JoshDreamland 10 years, 3 months ago

Okay, I guess my concerns were in vain. This is a tight system.

The edit changed the output for the worse, but, by virtue of the fact that tags can't contain [ or ], there's no problem with the above. I feel there's still room for improvement…

KaBob799 10 years, 3 months ago

Dang my edit to the usertag code is gone now =[

KaBob799 10 years, 3 months ago

There's text in that comment, it's invisible for some reason =/

aeron 10 years, 3 months ago

JOOOOOooooooooooOOOOSH!

On a more informative note, it appears the parser doesn't like comments that contain a [

….without a closing ]

[ Also you apparently can't put bbcode inside square brackets ]