Code to convert string with ANSI/XTerm escape codes into HTML