Skip to content

Commit 87fadc3

Browse files
maxb2Matthew Anderson
authored andcommitted
fix: brace regex
1 parent c837870 commit 87fadc3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/blacken_docs/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
re.DOTALL | re.MULTILINE,
2525
)
2626
PYGMENTS_PY_LANG_CLASSES_RE_FRAGMENT = (
27-
f"({'|'.join([f'.{lang}' for lang in PYGMENTS_PY_LANGS])})"
27+
"(" + "|".join([r"\." + lang for lang in PYGMENTS_PY_LANGS]) + ")"
2828
)
2929
MD_BRACE_RE = re.compile(
30-
r"(?P<before>^(?P<indent> *)```\s*\{\s*\."
30+
r"(?P<before>^(?P<indent> *)```\s*\{\s*"
3131
+ PYGMENTS_PY_LANG_CLASSES_RE_FRAGMENT
3232
+ r"( [^\}\n]*?)?\}\s*?\n)"
3333
r"(?P<code>.*?)"

0 commit comments

Comments
 (0)