mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Refs #27753 -- Removed unused django.utils.text._replace_entity() and _entity_re.
Unused since 157ab32f34
.
This commit is contained in:
parent
826701232c
commit
a21a63cc28
@ -1,4 +1,3 @@
|
||||
import html.entities
|
||||
import re
|
||||
import unicodedata
|
||||
from gzip import GzipFile, compress as gzip_compress
|
||||
@ -338,28 +337,6 @@ def smart_split(text):
|
||||
yield bit[0]
|
||||
|
||||
|
||||
def _replace_entity(match):
|
||||
text = match[1]
|
||||
if text[0] == '#':
|
||||
text = text[1:]
|
||||
try:
|
||||
if text[0] in 'xX':
|
||||
c = int(text[1:], 16)
|
||||
else:
|
||||
c = int(text)
|
||||
return chr(c)
|
||||
except ValueError:
|
||||
return match[0]
|
||||
else:
|
||||
try:
|
||||
return chr(html.entities.name2codepoint[text])
|
||||
except KeyError:
|
||||
return match[0]
|
||||
|
||||
|
||||
_entity_re = _lazy_re_compile(r"&(#?[xX]?(?:[0-9a-fA-F]+|\w{1,8}));")
|
||||
|
||||
|
||||
@keep_lazy_text
|
||||
def unescape_string_literal(s):
|
||||
r"""
|
||||
|
Loading…
Reference in New Issue
Block a user