@@ 221,7 221,7 @@ XHTML support was contributed by Michael
'''
-import cgi
+import html
class HTML(object):
@@ 286,7 286,7 @@ class HTML(object):
special to HTML will be escaped.
'''
if escape:
- text = cgi.escape(text)
+ text = html.escape(text)
# adding text
if self._top:
self._stack[-1]._content.append(text)
@@ 312,7 312,7 @@ class HTML(object):
escape = kw.pop('escape', True)
if content:
if escape:
- self._content = list(map(cgi.escape, content))
+ self._content = list(map(html.escape, content))
else:
self._content = list(content)
if 'newlines' in kw:
@@ 320,9 320,9 @@ class HTML(object):
self._newlines = kw.pop('newlines')
for k in kw:
if k == 'klass':
- self._attrs['class'] = cgi.escape(kw[k], True)
+ self._attrs['class'] = html.escape(kw[k], True)
else:
- self._attrs[k] = cgi.escape(kw[k], True)
+ self._attrs[k] = html.escape(kw[k], True)
return self
def __enter__(self):