diff --git a/src/Twig/Runtime/IconRuntime.php b/src/Twig/Runtime/IconRuntime.php index 751f4dd..28430c5 100644 --- a/src/Twig/Runtime/IconRuntime.php +++ b/src/Twig/Runtime/IconRuntime.php @@ -87,6 +87,7 @@ final class IconRuntime implements RuntimeExtensionInterface $rawSvgMarkup = $this->getSvgMarkup($iconFilepath); $cleanSvgMarkup = $this->removeExistingTitleElement($rawSvgMarkup); $cleanSvgMarkup = $this->removeBlackStrokeAttributes($cleanSvgMarkup); + $cleanSvgMarkup = $this->removeStrokeCurrentColor($cleanSvgMarkup); return $this->removeBlackFillAttributes($cleanSvgMarkup); } @@ -119,6 +120,11 @@ final class IconRuntime implements RuntimeExtensionInterface return preg_replace('/stroke(=|:)"?\s*(#0{6}|#000|rgb\(\s*0,\s*0,\s*0\s*\)|black)\s*"?/', '', $content); } + private function removeStrokeCurrentColor(string $content): string + { + return \preg_replace('/stroke=(\'|")currentColor(\'|")/', '', $content); + } + private function removeBlackFillAttributes(string $content): string { return preg_replace('/fill(=|:)"?\s*(#0{6}|#000|rgb\(\s*0,\s*0,\s*0\s*\)|black)\s*"?/', '', $content);