This is a great script, thanks!
However, while trying to parse bbcode into html I am unable to parse bbcode where there is a newline inside it.
Try parsing this...
bbcodeParser.addBBCode('[list]{TEXT}[/list]', '<ul>{TEXT}</ul>');
with a couple paragraphs of text.
Any ideas?