From ac72d623f08ffa9c4c1bb76c774807aac1ad037a Mon Sep 17 00:00:00 2001 From: canewsin Date: Wed, 5 Oct 2022 03:33:50 +0530 Subject: [PATCH] remove duplicate xescape(s) --- src/Ui/UiRequest.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/Ui/UiRequest.py b/src/Ui/UiRequest.py index 44e71ba6..ba09814c 100644 --- a/src/Ui/UiRequest.py +++ b/src/Ui/UiRequest.py @@ -543,25 +543,6 @@ class UiRequest(object): if show_loadingscreen: meta_tags += ''; - - def xescape(s): - '''combines parts from re.escape & html.escape''' - # https://github.com/python/cpython/blob/3.10/Lib/re.py#L267 - # '&' is handled otherwise - re_chars = {i: '\\' + chr(i) for i in b'()[]{}*+-|^$\\.~# \t\n\r\v\f'} - # https://github.com/python/cpython/blob/3.10/Lib/html/__init__.py#L12 - html_chars = { - '<' : '<', - '>' : '>', - '"' : '"', - "'" : ''', - } - # we can't replace '&' because it makes certain zites work incorrectly - # it should however in no way interfere with re.sub in render - repl = {} - repl.update(re_chars) - repl.update(html_chars) - return s.translate(repl) def xescape(s): '''combines parts from re.escape & html.escape'''