fix RegexHeuristics _remove_pre_tag
This commit is contained in:
parent
d7152d684b
commit
f4696b35b2
2 changed files with 9 additions and 1 deletions
|
@ -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:
|
||||||
|
|
|
@ -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>", "```"],
|
||||||
|
),
|
||||||
(
|
(
|
||||||
[
|
[
|
||||||
"```",
|
"```",
|
||||||
|
|
Loading…
Reference in a new issue