From e0acd3b789667894a0d78919b94f382a6a9f0f31 Mon Sep 17 00:00:00 2001 From: eri24816 Date: Sat, 14 Sep 2024 22:07:38 +0800 Subject: [PATCH] Escape right square bracket --- markdownify/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdownify/__init__.py b/markdownify/__init__.py index cd66a39..ba40ba4 100644 --- a/markdownify/__init__.py +++ b/markdownify/__init__.py @@ -208,7 +208,7 @@ def escape(self, text): if not text: return '' if self.options['escape_misc']: - text = re.sub(r'([\\&<`[>~#=+|-])', r'\\\1', text) + text = re.sub(r'([\\&<`[\]>~#=+|-])', r'\\\1', text) text = re.sub(r'([0-9])([.)])', r'\1\\\2', text) if self.options['escape_asterisks']: text = text.replace('*', r'\*')