Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
logilab-mtconverter
Commits
4bca0f6ba081
Commit
d221fc2d
authored
Aug 01, 2014
by
Rémi Cardona
Browse files
[py3k] Import name2codepoint from six.moves
Related to #268148.
parent
cdaa06f45b89
Changes
1
Hide whitespace changes
Inline
Side-by-side
__init__.py
View file @
4bca0f6b
...
...
@@ -35,10 +35,11 @@ import locale
import
mimetypes
import
re
import
string
import
htmlentitydefs
import
codecs
from
io
import
BytesIO
from
six.moves.html_entities
import
name2codepoint
try
:
import
chardet
except
ImportError
:
...
...
@@ -144,7 +145,7 @@ def xml_escape(data):
def
html_unescape
(
data
):
"""unescapes XML/HTML entities"""
for
entityname
,
codepoint
in
htmlentitydefs
.
name2codepoint
.
iter
items
():
for
entityname
,
codepoint
in
name2codepoint
.
items
():
data
=
data
.
replace
(
'&%s;'
%
entityname
,
unichr
(
codepoint
))
return
data
.
replace
(
'''
,
"'"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment