Convert BBCode to HTML and check whether the BBCode is valid