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

Josea 10 years, 11 months ago

Woah, Markdown is actually a very nice feature. Good job.

JoshDreamland 10 years, 11 months ago

Okay, I have to test this markdown shit.[/md] YES, YES, YES. Also, fuck you, [furry]. I told you this would work. Okay, yeah, not a very tasteful use of a tag. But neither is [quote][quote][quote][hide][quote][quote][quote][quote] this. [/quote][/quote][/quote][/quote][/hide][/quote][/quote][/quote] Well, all right; that didn't break it. I'm sure someone will, though. ✔ [url=google.com" onclick="alert('aeron-kun…')]Linky[/url] of doom ✔ [img]google.com/images/logo.png" onclick="alert('titties!')[/img] image of doom

aeron 10 years, 11 months ago

[tnail]<a rel="nofollow" href="http://files.64digits.com/aeron/plunge2.gif[/tnail">http://files.64digits.com/aeron/plunge2.gif[/tnail</a>]
[tnail width=100]<a rel="nofollow" href="http://files.64digits.com/aeron/plunge2.gif[/tnail">http://files.64digits.com/aeron/plunge2.gif[/tnail</a>]
[tnail height=40]<a rel="nofollow" href="http://files.64digits.com/aeron/plunge2.gif[/tnail">http://files.64digits.com/aeron/plunge2.gif[/tnail</a>]

I love that bbcode inside a code tag never gets parsed. This means there's no chance some array access (think array) get's parsed as bbcode, but it also means you can show off bbcode markup easily without having to [[blk]blk] everything.

JoshDreamland 10 years, 11 months ago

Did the old parser not do that?

Note to any concerned FirestormXs: I only promised that the Markdown wouldn't break old posts. The rest of the parser is fair game to break old posts.

Also, aeron, images aren't being auto-sized to max-width:100% anymore. My blog now has slightly too fat images.

Also, a lot of board software has a [noparse][noparse][/noparse] tag. As opposed to or in addition to a [[blk]blk] tag.

Acid 10 years, 11 months ago

<3

LAR Games 10 years, 11 months ago

Cool.

aeron 10 years, 11 months ago

Acid 10 years, 10 months ago

Tall Ass Mo

panzercretin 10 years, 10 months ago

how the hell does someone make a minute-long gif that loads perfectly

9 times outta 10 gifs like that get all choppy and only play nice on the second run

you're a wizard aren't you

Astryl 10 years, 10 months ago

Looks like aeron found Late Night News :P

Well, it's nice that we have an improvement over the last bbcode system. I remember taking a look at the code once, and it was basically a long list of if…else blocks.