Skip to content

Commit

Permalink
fix: support single quotes for base64 encoded value in img tag as well
Browse files Browse the repository at this point in the history
Refs: #69
  • Loading branch information
grigoriev committed Sep 19, 2024
1 parent 98f1d1b commit 3f6fc94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/SvgUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Process img tags, replacing base64 SVG images with PNGs
def process_svg(html):
pattern = re.compile(r'<img(?P<intermediate>[^>]+?src=(?P<quote>[\'"]))(data:(?P<type>[^;>]*?);base64,\s?(?P<base64>[^">]*?)(?P=quote))')
pattern = re.compile(r'<img(?P<intermediate>[^>]+?src=(?P<quote>[\'"])data:)((?P<type>[^;>]*?);base64,\s?(?P<base64>.*?)(?P=quote))')
return re.sub(pattern, replace_img_base64, html)


Expand Down

0 comments on commit 3f6fc94

Please sign in to comment.