Skip to content

Commit de045a4

Browse files
committed
Update Helpers.php
1 parent 6b0fbc2 commit de045a4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Helpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ public static function svg(string $icon, int $size = 16): ?string {
146146

147147
if (is_file($file)) {
148148
$content = trim(file_get_contents($file));
149-
$attributes = 'width="'.$size.'" height="'.$size.'" fill="currentColor" viewBox="0 0 16 16"';
149+
preg_match('~<svg([^<>]*)>~', $content, $attributes);
150150

151-
return preg_replace('~<svg([^<>]*)>~', '<svg xmlns="http://www.w3.org/2000/svg" '.$attributes.'>', $content);
151+
return preg_replace('~<svg([^<>]*)>~', '<svg'.$attributes[1].' width="'.$size.'" height="'.$size.'">', $content);
152152
}
153153

154154
return null;

0 commit comments

Comments
 (0)