WoltLab/WCF — Issue #375: Rework Message Parser / BBCode System
Author: NetzwergX
Created: 2012-01-12 08:46:09+00:00
State: open

I just had a deeper look into the message and BBcode system, and i noticed that it is still as ugly as hell from an plugin developers point of view.

If you want to parse a message on your own, this is still nearly impossible. The only entry point is in the URLParser, but that is only executed, when the atomatic URL detection is active.

I would like to propose some changes:

1.) Divide the MessageParser from the BBCode parsing.
2.) Additional Parsers can be registered via PIP. You can specify in that PIP for what type of Message that Parser can be used.
3.) The message parser then loads all available Parsers and executes them.
4.) MessageForm also reads all available parsers and displays the appropriate option (e.g. "Use BBCodes", "Detect URLs automatically")
5.) of course a distinction is needed wether the specific parser should only be run once before saving the post (e.g. the URLParser, since it replaces text), or the parser is run in order to display the message. Maybe the former should be called "MessageFilter" and the latter "MessageParser".

This would not only allow developers to register own parsers to existing messages, but it would also allow them to easily create new types of messages, e.g. for a cms, where you might not wan't to use BBCodes at all, but e.g. markdown or other things. it would even allow for plugins to create parsers that depend on native libraries, e.g. textile u.v.m.

If something like this is worth consideration, i will start working on that and provide a demonstration / pull requests to message and BBCode system.