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