Skip to content

Commit

Permalink
fix: brace regex
Browse files Browse the repository at this point in the history
  • Loading branch information
maxb2 committed Aug 16, 2023
1 parent 6ebbada commit 9d0db61
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 @@ -22,10 +22,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 9d0db61

Please sign in to comment.