@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes |
58 | - $html['body'] = preg_replace_callback('/<img(?<pre>[^>]*)src="(?<src>\/[^"]+\.svg)"(?<post>[^>]*?)[\s\/]*>/s', function (array $matches): string { // ^[/] |
|
58 | + $html['body'] = preg_replace_callback('/<img(?<pre>[^>]*)src="(?<src>\/[^"]+\.svg)"(?<post>[^>]*?)[\s\/]*>/s', function(array $matches): string { // ^[/] |
|
59 | 59 | if (!isset($this->svgFileArr[$matches['src']])) { // check usage |
60 | 60 | return $matches[0]; |
61 | 61 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | }, $html['body']); |
66 | 66 | |
67 | 67 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object#attributes |
68 | - $html['body'] = preg_replace_callback('/<object(?<pre>[^>]*)data="(?<data>\/[^"]+\.svg)"(?<post>[^>]*?)[\s\/]*>(?:<\/object>)/s', function (array $matches): string { // ^[/] |
|
68 | + $html['body'] = preg_replace_callback('/<object(?<pre>[^>]*)data="(?<data>\/[^"]+\.svg)"(?<post>[^>]*?)[\s\/]*>(?:<\/object>)/s', function(array $matches): string { // ^[/] |
|
69 | 69 | if (!isset($this->svgFileArr[$matches['data']])) { // check usage |
70 | 70 | return $matches[0]; |
71 | 71 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | $svg = preg_replace_callback( |
130 | 130 | '/<use(?<pre>.*?)(?:xlink:)?href="(?<href>\/.+?\.svg)#[^"]+"(?<post>.*?)[\s\/]*>(?:<\/use>)?/s', |
131 | - function (array $matches): string { |
|
131 | + function(array $matches): string { |
|
132 | 132 | return sprintf('<use%s href="#%s"/>', $matches['pre'].$matches['post'], $this->convertFilePath($matches['href'])); |
133 | 133 | }, |
134 | 134 | '<svg xmlns="http://www.w3.org/2000/svg">' |