Skip to content

Commit 3932676

Browse files
authored
Allow matching prefix with curly braces in CodeExample.prefix_settings() (#44)
The SuperFences markdown extensions uses the following format for attributes: `lang-name {.extra-class attr="a"}` See: https://facelessuser.github.io/pymdown-extensions/extensions/superfences/#injecting-classes-ids-and-attributes
1 parent 8ae0f2a commit 3932676

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytest_examples/find_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def prefix_settings(self) -> dict[str, str]:
7676
This works on the format `py foo="bar" spam="with space"`.
7777
"""
7878
settings = {}
79-
for m in re.finditer(r'(\S+?)=([\'"])(.+?)\2', self.prefix):
79+
for m in re.finditer(r'([^{\s]+?)=([\'"])(.+?)\2', self.prefix):
8080
settings[m.group(1)] = m.group(3)
8181
return settings
8282

0 commit comments

Comments
 (0)