remove control characters from xml

This commit is contained in:
ebbit1q
2021-05-27 23:23:10 +02:00
parent 103279671d
commit 0f4ec17eb6

View File

@@ -21,7 +21,9 @@ SPOILER_SETS: contextvars.ContextVar = contextvars.ContextVar("SPOILER_SETS")
OUTPUT_DIR = pathlib.Path("out")
OUTPUT_TMP_DIR = OUTPUT_DIR.joinpath("tmp")
XML_ESCAPE_TRANSLATE_MAP = str.maketrans(
{"&": "&amp;", '"': "&quot;", "<": "&lt;", ">": "&gt;"}
{"&": "&amp;", '"': "&quot;", "<": "&lt;", ">": "&gt;",
# remove any control characters outright
**{chr(i): "" for i in range(ord(" "))}}
)