From 619532f03bfee67021e85c6d35b614381366de37 Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Sat, 7 Sep 2024 17:59:15 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20[WIP/TEST]=20=E3=82=A8=E3=82=B9?= =?UTF-8?q?=E3=82=B1=E3=83=BC=E3=83=97=E6=96=87=E5=AD=97=E3=81=AB=E3=82=88?= =?UTF-8?q?=E3=82=8B=E7=BF=BB=E8=A8=B3=E3=81=97=E3=81=AA=E3=81=84=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E3=82=92=E8=A8=AD=E5=AE=9A=E3=81=A7=E3=81=8D=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit プレースホルダーの形式を修正 ex) "0x1000" -> " <$ 0x1000> " --- src-python/webui_controller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-python/webui_controller.py b/src-python/webui_controller.py index 619a24c2..61db6aec 100644 --- a/src-python/webui_controller.py +++ b/src-python/webui_controller.py @@ -297,7 +297,7 @@ def replaceExclamationsWithRandom(text): def replace(match): original = match.group(1) nonlocal num - rand_value = hex(num) + rand_value = f" <$ {hex(num)}> " replacement_dict[rand_value] = original num += 1 return str(rand_value) @@ -311,7 +311,7 @@ def restoreText(escaped_text, escape_dict): # 大文字小文字を無視して置換するために、正規表現を使う for escape_seq, char in escape_dict.items(): # escape_seq の部分を case-insensitive で置換 - escaped_text = re.sub(re.escape(escape_seq), char, escaped_text, flags=re.IGNORECASE) + escaped_text = re.sub(re.escape(escape_seq[1:-1]), char, escaped_text, flags=re.IGNORECASE) return escaped_text def removeExclamations(text):