Skip to content

Commit

Permalink
fix: change the img tag regex matching to non-greedy
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaokang2022 committed Oct 7, 2024
1 parent 317104d commit 7d76845
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mkdocs_glightbox/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def repl_html(match):
return html

markdown = re.sub("!\\[[^\\]]*\\]\\([^)]*\\)", repl_md, markdown)
markdown = re.sub("<img.*>", repl_html, markdown)
markdown = re.sub("<img\\s+[^>]*>", repl_html, markdown)

return markdown

Expand Down

0 comments on commit 7d76845

Please sign in to comment.