fix RegexHeuristics _remove_pre_tag

This commit is contained in:
Denis-Cosmin NUTIU 2023-06-02 10:54:53 +03:00
parent d7152d684b
commit f4696b35b2
2 changed files with 9 additions and 1 deletions

View file

@ -13,7 +13,7 @@ class RegexHeuristics:
self.configurator = configurator self.configurator = configurator
self._rules = { self._rules = {
"^(</*pre.*?>)(?P<content>.*?)`{0,3}(<\/pre>)?$": self._remove_pre_tag, "^(</*pre.*?>)`{0,3}(?P<content>.*?)(<\/pre>)?$": self._remove_pre_tag,
} }
def _remove_pre_tag(self, match) -> str: def _remove_pre_tag(self, match) -> str:

View file

@ -124,6 +124,14 @@ def test_fix_html_tags_stripe_tag(input_lines, expected_lines):
], ],
["```", " <ItemGroup>", "```"], ["```", " <ItemGroup>", "```"],
), ),
(
[
"```",
'<pre class="wp-block-syntaxhighlighter-code">``` <ItemGroup>',
"```",
],
["```", " <ItemGroup>", "```"],
),
( (
[ [
"```", "```",