Merge pull request #1983 from driscoll/bugfixes

Replacing deprecated method from cgi with html.escape()
This commit is contained in:
Griatch 2019-10-30 19:15:41 +01:00 committed by GitHub
commit 43fa246bf2

View file

@ -9,7 +9,7 @@ snippet #577349 on http://code.activestate.com.
"""
import re
import cgi
from html import escape as html_escape
from .ansi import *
@ -304,7 +304,7 @@ class TextToHTMLparser(object):
"""
cdict = match.groupdict()
if cdict["htmlchars"]:
return cgi.escape(cdict["htmlchars"])
return html_escape(cdict["htmlchars"])
elif cdict["lineend"]:
return "<br>"
elif cdict["firstspace"]: