Replace delimiters with unicode shapes

This commit is contained in:
2026-03-19 00:40:27 -04:00
parent 467c1464aa
commit e9ad41bbb3
9 changed files with 91 additions and 60 deletions

View File

@@ -15,6 +15,15 @@ HOST = "localhost"
PORT = 9847
TIMEOUT = 120
# Map ASCII characters to the Unicode geometric delimiters used by the plugin.
DELIMITER_MAP = str.maketrans({
'<': '',
'>': '',
'*': '',
'.': '',
'|': '',
})
def main():
args = sys.argv[1:]
if not args:
@@ -35,6 +44,11 @@ def main():
pass
msg[key] = value
# Translate ASCII delimiter shortcuts to Unicode geometric shapes.
for key, value in msg.items():
if isinstance(value, str):
msg[key] = value.translate(DELIMITER_MAP)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(TIMEOUT)
try: