2013-06-29, 10:24 PM
Hi!
I'm the author of s9e\TextFormatter, a text formatting library that supports BBCodes and most other features found in forums, implemented as plugins. My goal is to have it used by forum softwares and other commenting systems, and I'm currently contacting open source projects like MyBB to see how we can work together.
Even though s9e\TextFormatter's code is fairly mature (years of development and thousands of unit tests) it's a hobby project and I'm still figuring out how to make it more accessible to open source projects like MyBB. I've only started writing a cookbook of short functional examples recently, and there's a lot of material to cover so I think it's more efficient for me to just go ask developers what they're looking for so that I can prioritize it accordingly.
MyBB 2.0 is in the early stages of development, so I see it as an opportunity not only for you to benefit from offloading the development of your text processing but also for me to draw from your feedback and better discern what kind of text formatting the next generation of forums want.
I don't want to post a bigger wall of text than it already is so I'll try to summarize the big lines below. Every text formatting library out there claims the same qualities ("fast! secure! easy!") and it's hard to highlight what makes s9e\TextFormatter different because everyone has different expectations. If there's something that I should have included but I didn't, please feel free to ask. Otherwise, there's more info in this document and a working example of a basic parser there.
If you have any questions, please feel free to ask.
I'm the author of s9e\TextFormatter, a text formatting library that supports BBCodes and most other features found in forums, implemented as plugins. My goal is to have it used by forum softwares and other commenting systems, and I'm currently contacting open source projects like MyBB to see how we can work together.
Even though s9e\TextFormatter's code is fairly mature (years of development and thousands of unit tests) it's a hobby project and I'm still figuring out how to make it more accessible to open source projects like MyBB. I've only started writing a cookbook of short functional examples recently, and there's a lot of material to cover so I think it's more efficient for me to just go ask developers what they're looking for so that I can prioritize it accordingly.
MyBB 2.0 is in the early stages of development, so I see it as an opportunity not only for you to benefit from offloading the development of your text processing but also for me to draw from your feedback and better discern what kind of text formatting the next generation of forums want.
I don't want to post a bigger wall of text than it already is so I'll try to summarize the big lines below. Every text formatting library out there claims the same qualities ("fast! secure! easy!") and it's hard to highlight what makes s9e\TextFormatter different because everyone has different expectations. If there's something that I should have included but I didn't, please feel free to ask. Otherwise, there's more info in this document and a working example of a basic parser there.
- Plugin-based. Look into the Plugins directory on GitHub, there's a couple of examples in each subdirectory.
- The BBCodes plugin is very flexible and robust. It doesn't get tripped by malformed or misnested tags. It supports and extends the same custom BBCodes syntax as phpBB's, meaning that users can create their own BBCodes without touching the code. Also, there are safeguards in place to prevent unsafe BBCodes from being created.
- There's also a plugin (unimaginatively called Generic) that performs generic replacements similar to MyBB's MyCode. Like custom BBCodes, unsafe replacements (e.g. unfiltered content in an onclick attribute, or in a URL) are detected.
- There's no Markdown plugin yet, but it's on my longterm TODO list and I can reprioritize it on demand.
- The formatting is done on an internal representation of the text. It doesn't alter the text via preg_replace() or similar, meaning that a bad regexp won't leak unfiltered input or create a XSS vector. Input is always filtered and XSS is taken seriously.
- Continuously tested on Travis:
If you have any questions, please feel free to ask.