Skip to content

Commit

Permalink
normalize.py: use html.escape instead of cgi.escape.
Browse files Browse the repository at this point in the history
Closes #313.
  • Loading branch information
jgm committed Nov 28, 2019
1 parent 7b35d4b commit 68c3a91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class HTMLParseError(Exception):
from html.entities import name2codepoint
import sys
import re
import cgi
import html

# Normalization code, adapted from
# https://github.com/karlcow/markdown-testsuite/
Expand Down Expand Up @@ -66,7 +66,7 @@ def handle_starttag(self, tag, attrs):
self.output += ("=" + '"' +
urllib.quote(urllib.unquote(v), safe='/') + '"')
elif v != None:
self.output += ("=" + '"' + cgi.escape(v,quote=True) + '"')
self.output += ("=" + '"' + html.escape(v,quote=True) + '"')
self.output += ">"
self.last_tag = tag
self.last = "starttag"
Expand Down

0 comments on commit 68c3a91

Please sign in to comment.