We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc1ce8e commit b62b125Copy full SHA for b62b125
src/card.php
@@ -494,6 +494,15 @@ function convertSvgToPng(string $svg): string
494
$svg = preg_replace("/(animation: currstreak[^;'\"]+)/m", "font-size: 28px;", $svg);
495
$svg = preg_replace("/<a \X*?>(\X*?)<\/a>/m", '\1', $svg);
496
497
+ // replace all fully transparent colors in fill or stroke with "none"
498
+ // this is a workaround for what seems to be a bug in inkscape where rgba alpha values are ignored
499
+ // TODO: find a way to make partially transparent colors work (eg. #ffffff50)
500
+ $svg = preg_replace(
501
+ "/(fill|stroke)=['\"](?:#[0-9a-fA-F]{6}00|#[0-9a-fA-F]{3}0|transparent)['\"]/m",
502
+ '\1="none"',
503
+ $svg
504
+ );
505
+
506
// escape svg for shell
507
$svg = escapeshellarg($svg);
508
0 commit comments