diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-12-30 13:19:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-30 13:19:25 +0100 |
| commit | a21a63cc288ba51bcf8c227a49de6f5bb9a72cc3 (patch) | |
| tree | 26bb26a26bb354377026acf0d2144c1ea5486948 | |
| parent | 826701232c4d82ddf1fe0fd073a1a9f3316d2061 (diff) | |
Refs #27753 -- Removed unused django.utils.text._replace_entity() and _entity_re.
Unused since 157ab32f3446da7fa1f9d716509c290069a2a156.
| -rw-r--r-- | django/utils/text.py | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/django/utils/text.py b/django/utils/text.py index fa337650af..915da50483 100644 --- a/django/utils/text.py +++ b/django/utils/text.py @@ -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""" |
