Test for black fill and stroke style removal

This commit is contained in:
Brabli
2022-08-29 19:31:27 +01:00
parent 3e4b948569
commit 27dfa0af2e
3 changed files with 21 additions and 2 deletions

View File

@@ -179,12 +179,12 @@ final class IconExtension extends AbstractExtension
private function removeBlackStrokeAttributes(string $content): string
{
return preg_replace('/stroke="\s*(#0{6}|#000|rgb\(\s*0,\s*0,\s*0\s*\)|black)\s*"/', '', $content);
return preg_replace('/stroke(=|:)"?\s*(#0{6}|#000|rgb\(\s*0,\s*0,\s*0\s*\)|black)\s*"?/', '', $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);
return preg_replace('/fill(=|:)"?\s*(#0{6}|#000|rgb\(\s*0,\s*0,\s*0\s*\)|black)\s*"?/', '', $content);
}
}