Skip to content

Commit

Permalink
update regex
Browse files Browse the repository at this point in the history
  • Loading branch information
johanrosenson committed Mar 18, 2021
1 parent 2a9414a commit e0db967
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FontAwesomeComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private function getSvg(string $package, string $style, string $name) : array

$match = null;

if (! preg_match('~<svg .+viewBox="(?P<viewBox>0 0 (?P<width>\d+) (?P<height>\d+))"><!--.+--><path d="(?P<path>[^"]+)"/></svg>~', $contents, $match)) {
if (! preg_match('~<svg .+viewBox="(?P<viewBox>0 0 (?P<width>\d+) (?P<height>\d+))"><!--.+--><path d="(?P<path>[^"]+)"(?:/>|></path>)</svg>~', $contents, $match)) {
throw new \RuntimeException('Invalid icon, failed to parse svg');
}

Expand Down

0 comments on commit e0db967

Please sign in to comment.