mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2026-07-23 22:33:42 -04:00
Fixed social plugin crashing for CairoSVG >= 2.8
Co-authored-by: kamilkrzyskow <34622465+kamilkrzyskow@users.noreply.github.com>
This commit is contained in:
@@ -443,10 +443,9 @@ class SocialPlugin(BasePlugin[SocialConfig]):
|
||||
# Fill with color, if given
|
||||
if fill:
|
||||
data = data.replace("<svg", f"<svg fill=\"{fill}\"")
|
||||
data = data.encode("utf-8")
|
||||
|
||||
# Convert to PNG and return image
|
||||
svg2png(bytestring = data, write_to = file, scale = 10)
|
||||
svg2png(bytestring = data.encode("utf-8"), write_to = file, scale = 10)
|
||||
return Image.open(file)
|
||||
|
||||
# Retrieve font either from the card layout option or from the Material
|
||||
|
||||
Reference in New Issue
Block a user