Skip to content

Commit

Permalink
check if there is a match at all
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Ungar Felding committed Nov 13, 2024
1 parent e7db2cb commit 2ceaee1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymdownx/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def extract_regex(self, regex, lines):
regex = re.match(r'^/(.*)/$', regex).group(1) # remove the slashes
for line in lines:
m = re.match(regex, line)
if m.groups():
if m and m.groups():
new_lines.append(" ".join(re.match(nregex, line).groups())) # join the groups together
elif m:
new_lines.append(line)
Expand Down

0 comments on commit 2ceaee1

Please sign in to comment.