diff --git a/app/converter/regex_heuristics.py b/app/converter/regex_heuristics.py index 5ba2f4b..5e38124 100644 --- a/app/converter/regex_heuristics.py +++ b/app/converter/regex_heuristics.py @@ -13,7 +13,7 @@ class RegexHeuristics: self.configurator = configurator self._rules = { - "^()(?P.*?)`{0,3}(<\/pre>)?$": self._remove_pre_tag, + "^()`{0,3}(?P.*?)(<\/pre>)?$": self._remove_pre_tag, } def _remove_pre_tag(self, match) -> str: diff --git a/app/tests/converter/wordpress_markdown_test.py b/app/tests/converter/wordpress_markdown_test.py index 5c5f91b..97b1e56 100644 --- a/app/tests/converter/wordpress_markdown_test.py +++ b/app/tests/converter/wordpress_markdown_test.py @@ -124,6 +124,14 @@ def test_fix_html_tags_stripe_tag(input_lines, expected_lines): ], ["```", " ", "```"], ), + ( + [ + "```", + '
```    ',
+                "```",
+            ],
+            ["```", "    ", "```"],
+        ),
         (
             [
                 "```",