From 00ba71b3e3d99b6e3f48439ddedc7ce7f12a80f8 Mon Sep 17 00:00:00 2001 From: dousha Date: Mon, 6 Jan 2025 02:20:20 +0800 Subject: [PATCH] escape backslashes --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index f442afd..8a6676e 100644 --- a/main.py +++ b/main.py @@ -107,7 +107,8 @@ for item in items: lines[i + 1] = nextline content = '\n'.join(lines) - content = md(content, code_language_callback=code_parser).strip() + '\n' + content = md(content, code_language_callback=code_parser, + escape_misc=True).strip() + '\n' ref_regex = re.compile(r'\[ref](.+?)\[/ref]') refs = [] stuff = find_all_matches(ref_regex, content, 1)