BB code parser writen in TypeScript.