diff -r 24f8a621bfdd -r 679972640f47 py/gadict_html.py --- a/py/gadict_html.py Wed Sep 01 10:13:16 2021 +0300 +++ b/py/gadict_html.py Wed Sep 01 10:38:30 2021 +0300 @@ -5,7 +5,7 @@ import sys import codecs import re -import html +from xml.sax.saxutils import escape import gadict import gadict_freq @@ -67,7 +67,7 @@ try: DOM = PARSER.parse(FIN) except gadict.ParseException as ex: - sys.stdout.write("{:s}{:s}\n".format(FINAME, repr(ex))) + sys.stdout.write(u"{:s}{:s}\n".format(FINAME, repr(ex))) if __debug__: import traceback traceback.print_exc() @@ -111,36 +111,36 @@ """ FOUT.write(HTML_HEADER.format(title=PRELUDE.name)) -FOUT.write("
License: ") -FOUT.write(html.escape(", ".join(PRELUDE.licences))) +FOUT.write(escape(", ".join(PRELUDE.licences))) # FOUT.write("
\n") -# FOUT.write(html.escape(PRELUDE.about)) +# FOUT.write(escape(PRELUDE.about)) FOUT.write("
\n") def link(lst): buf = [] for el in lst: - el = html.escape(el) - lnk = "{}".format(el, el) + el = escape(el) + lnk = u"{}".format(el, el) buf.append(lnk) return "; ".join(buf) for (headwords, translations) in DOM[1:]: identity = headwords[0].headword - FOUT.write("") - FOUT.write(html.escape(",".join(freqtags))) + FOUT.write(escape(",".join(freqtags))) FOUT.write("
") FOUT.write("