Textile and the Starmen.Net Forums

As some of you might know, I — almost religiously — push Textile onto everybody on the Starmen.Net forums. I really like it since it makes a lot of organizational posts easy to do with all the block-level elements. Allowing inline styles is awesome too. Except that I highly parse the styles for certain elements now. Sarsie found all kinds of wonderful XSS attacks with CSS Expressions and IE6. I keep telling the story about a security problem with font colors.

Anyway, a lot of people have problems with the newlines and how they work. I’ve tried all kinds of things, but none of them work well really. Since I used RedCloth 3, the Ruby parser for Textile, there wasn’t a nice answer. Going without it is impossible, since there’s a legitimate reason to have single breaks. Enabling the official hard breaks on RedCloth 3 caused havoc on quotes and spoiler matocode tags. I eventually settled on an ugly hack.

In comes RedCloth 4. It fixes the line break issue, it’s a C-based extension for extra speed. And it doesn’t have disablers, it’s all or nothing. I have to disable images on the forum because it’s possible to display tasteless images. Not to mention the occasional Goatse hotlink protection. Stuff I really don’t want to be shown on a forum that has members of 12 or less.

However, We offer regular users the ability to post images in certain forums, like the Fan Forum, to show off their artwork. Administrators and moderators like images for various real needs, as well as special permissions allow certain users to post images for various needs. (ie. the runner of the currently running Mafia game.) So the feature disabler had to be easily disabled/enabled.

After a brief email in their mailing list, I manned up and added it myself. Unfortunately, I didn’t know Ragel, or Ruby C Extensions for that matter. It was a long and tough battle, but I defeated the final boss!


Hopefully — With the feature disabler that I needed — this fixes a lot of problems that have been plaguing the Textile implementation on the forum.

The next step is to port the crappy MatoCode (my implementation of BBCode) to the fancy Ragel system. Things like the [quote] and [spoiler] tags need to have their insides parsed separately from the outside.