Skip to content

Commit

Permalink
fix: brace regex
Browse files Browse the repository at this point in the history
  • Loading branch information
maxb2 authored and Matthew Anderson committed Oct 14, 2024
1 parent b4c353f commit e82e9e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/blacken_docs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
re.DOTALL | re.MULTILINE,
)
PYGMENTS_PY_LANG_CLASSES_RE_FRAGMENT = (
f"({'|'.join([f'.{lang}' for lang in PYGMENTS_PY_LANGS])})"
"(" + "|".join([r"\." + lang for lang in PYGMENTS_PY_LANGS]) + ")"
)
MD_BRACE_RE = re.compile(
r"(?P<before>^(?P<indent> *)```\s*\{\s*\."
r"(?P<before>^(?P<indent> *)```\s*\{\s*"
+ PYGMENTS_PY_LANG_CLASSES_RE_FRAGMENT
+ r"( [^\}\n]*?)?\}\s*?\n)"
r"(?P<code>.*?)"
Expand Down

0 comments on commit e82e9e9

Please sign in to comment.