Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Better BBCode Parser

edited August 2006 in Vanilla 1.0 Help
I've just started work on a lib for parsing BBCode, but with some extra and improved features:
  • Corrects any nesting issues, no more validation errors due to BBCode.
  • Lets custom BBCodes be written by supplying formats and matches:
    • Format: You specify exactly what you want the output to be.
    • Matches: Let you test content based on a regular expression.
As a quick example of what the formatting looks like, this would create a link from any URI other than an email address:
!attribute{isuri&notemail}{<a href="#attribute">#text</a>}!attribute{noturi|isemail}{#text}
You can see a similar idea which parses HTML here.

I don't have any more examples right now, but once its done I'll start working on the Add-on.

Comments

  • edited August 2006
    I highly recommend you modify the existing extension, rather than write your own. The PEAR BBCode Parser works just fine, and most of the bugs are either mistakes I made in porting it, or minor changes to the filters and pre/post parse regular expressions.

    If you have a good patch that fixes these things, I'd be glad to include it in the main extension, but it seems kind of silly to go to the work of writing your own.
  • Well now, I could do that, but I'm the kind of guy who gets a thrill out of writing something hard, so I'm not going to ;)
This discussion has been closed.