def tex_parse(string):
string = string.replace('<STR_LIT:{>', '<STR_LIT>').replace('<STR_LIT:}>', '<STR_LIT>')<EOL>def tex_replace(match):<EOL><INDENT>returnsub(r'<STR_LIT>', r'<STR_LIT>',<EOL>sub(r'<STR_LIT>', r'<STR_LIT>',<EOL>sub(r'<STR_LIT>', r'<STR_LIT>',<EOL>sub(r'<STR_LIT>', r'<STR_LIT>',<EOL>sub(r'<STR_LIT>' + GREEK_LETTERS + '<STR_LIT:)>', r'<STR_LIT>', match.group(<NUM_LIT:1>))))))<EOL><DEDENT>return mark_safe(sub(r'<STR_LIT>', tex_replace, escape(string)))<EOL>
Renders some basic TeX math to HTML.