Skip to content

Commit cc791a5

Browse files
committed
Fix bug in fixing image URLs, see #69
1 parent 58b4b76 commit cc791a5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mkdocs_print_site_plugin/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ def fix_image_src(page_html, page_url, directory_urls):
201201
This is because flattening all pages into 1 print page will break any relative links.
202202
"""
203203
# Loop over all images src attributes
204-
# Example regex https://regex101.com/r/TTRsVW/1
204+
# Example regex https://regex101.com/r/PLUmZ7/2
205205
img_regex = re.compile(
206-
r"\<img.+src=\"([aA-zZ|0-9|\-|\_|\.|\:|\/]+)\"", flags=re.IGNORECASE
206+
r"<img[^>]+src=\"([^\">]+)\"", flags=re.IGNORECASE
207207
)
208208
matches = re.finditer(img_regex, page_html)
209209

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name="mkdocs-print-site-plugin",
12-
version="2.3.2",
12+
version="2.3.3",
1313
description="MkDocs plugin that combines all pages into one, allowing for easy export to PDF and standalone HTML.",
1414
long_description=long_description,
1515
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)