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

KaBob799 10 years, 9 months ago

I am very good at breaking things =]

firestormx 10 years, 9 months ago

The old parser let you do that. :(

firestormx 10 years, 9 months ago

Sometimes I think a monkey could test 64D's code better than any 64D developer. :3

aeron 10 years, 9 months ago

You have a point, after all this place was built and tested by real life apes.

JoshDreamland 10 years, 9 months ago

Let's see…

[testing]

[testing ]

[ testing]

[ testing ]

[Edit:] Yep. Looks like we're in good shape.

[

sirxemic 10 years, 9 months ago

Aaaand patched!

JoshDreamland 10 years, 9 months ago

Sort of a nasty bug. Aeron, you mentioned earlier the idea of running both parsers on the whole DB for benchmarking purposes. Are you still planning on doing that? If so, I'd like if you could also strip the HTML of the results and report comments/blogs that are missing text in the new one. I'm not sure how much that'd be asking, but it'd help us make sure we're not losing information.

If you can get the dumps, I can do the diffs.

Acid 10 years, 9 months ago

ff - Borked

fdsafdffdafsfafd - Borked (Same method)

butts

Michael
Jordan

Using reference links

I get 10 times more traffic from [Google] [x] than from [Yahoo] [!] or [MSN] [2]. - Borked

[x]: http://google.com/ "Google" [!]: http://search.yahoo.com/ "Yahoo Search" [2]: http://search.msn.com/ "MSN Search"

Actually, the reference links just plain don't work. Also, the above was just messing with the current bbcode.

<a href="http://google.com">googleee</a>

<a href="http://google.com">googleee</a>

<a href="http://google.com">googleee</a>

Not really broken… but semi-colon appears?

<div width="100%">googleee</div>

    [+]Seven

    [x]Eight
    [#]Nine
- Borked… or maybe just right?

You guys did a really good job on this! I found some stuff, but overall it's stuff that nobody would even really do (and it doesn't really affect much besides making the comment reflect the writer's ineptitude :P).

aeron 10 years, 9 months ago

The improperly nested tags thing was intentional, though it could be "fixed" by ignoring the name of the closing tag. Oh and good find on the markdown thing. I guess our markdown parser doesn't support the link titles used in that example (which I shamelessly ripped). It is supposed to be github flavored markdown however.

Another form of reference links:

[md]
I get 10 times more traffic from [Google][] than from 
[Yahoo][] or [MSN][].

  [google]: <a rel="nofollow" href="http://google.com/">http://google.com/</a>
  [yahoo]:  <a rel="nofollow" href="http://search.yahoo.com/">http://search.yahoo.com/</a>
  [msn]:    <a rel="nofollow" href="http://search.msn.com/">http://search.msn.com/</a>
[/md]
Quote:

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

[google]: http://google.com/ [yahoo]: http://search.yahoo.com/ [msn]: http://search.msn.com/ [/md]

JoshDreamland 10 years, 9 months ago

I wish people could agree on what markdown actually is. It's a good thing I don't know much markdown, or I'd be pretty pissed trying to use it between GitHub, forums, Doxygen, and wherever.

Anyway, yes; the mismatched closing tag behavior is intentional. I don't like the way HTML quirks handles it, and I don't want to proliferate the practice. Everyone basically agreed and I imagine most people will continue to basically agree with the sentiment.