BBCode Reader for Pandoc
While migrating my ancient BBCode formatted blog posts to a more modern format, I managed to write some real world Haskell in the form of a Pandoc plugin.
Pandoc’s architecture is composed of readers translating input formats into an abstract syntax tree (AST) which is subsequently rendered into various output formats.
Because BBCode is rather under specified, I only implemented the subset
I needed for my inputs. Notable omissions include the [table]
,
[color]
and [size]
tags. The non standard headings ([h1]
up until [h6]
) are recognized. The optional pandoc title block
extension
is supported.
pandoc -f bbcode -t markdown article.bb
Anyway, maybe it is useful for somebody out there. The code is located in the bbcode-reader branch on Github.