views:

209

answers:

0

I have a phpBB2 forum with posts stored in BBCode. The forum posts are stored like this in the database:

[quote:e5adceb8e8][quote:e5adceb8e8="Person 2"][quote:e5adceb8e8="Person 3"]Nested quote[/quote:e5adceb8e8]Another nested quote[/quote:e5adceb8e8]Some text[/quote:e5adceb8e8]

[b:e5adceb8e8]Some bold text[/b:e5adceb8e8]
[i:e5adceb8e8]italic text[/i:e5adceb8e8]
[u:e5adceb8e8]underlined text[/u:e5adceb8e8]

[code:1:e5adceb8e8]print ("hello world!");[/code:1:e5adceb8e8]

[img:e5adceb8e8]http://www.google.co.nz/intl/en_com/images/logo_plain.png[/img:e5adceb8e8]

[url]http://google.com[/url]

[url=http://google.com]Google[/url]

[color=darkred:e5adceb8e8]
Coloured text[/color:e5adceb8e8]

[size=18:e5adceb8e8]
Big text[/size:e5adceb8e8]

[list:e5adceb8e8]
List Item 1
List Item 2
[/list:u:e5adceb8e8]

[list:e5adceb8e8]
[*:e5adceb8e8]List Item 1
[*:e5adceb8e8]List Item 2
[/list:u:e5adceb8e8]

[list=1:e5adceb8e8]
[*:e5adceb8e8]List Item 1
[*:e5adceb8e8]List Item 2
[/list:o:e5adceb8e8]

[list=a:e5adceb8e8]
[*:e5adceb8e8]List Item 1
[*:e5adceb8e8]List Item 2
[/list:o:e5adceb8e8]

I'm after any tools that could help me convert this syntax to Markdown. Ideally I'd only want to convert the [b], [i], [quote], [url], [code], and [list] tags. It would be preferable to convert the [img] tags to links in Markdown to avoid page resizing problems. Any purely presentational elements such as the [color] and [size] tags would converted to plain text.