@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attributes |
92 | - $dom['body'] = preg_replace_callback('/<img(?<pre>[^>]*)src="(?:https?:)?(?:\/\/[^\/]+?)?(?<src>\/[^"]+\.svg)"(?<post>[^>]*?)[\s\/]*>(?!\s*<\/picture>)/s', function (array $match): string { // ^[/] |
|
92 | + $dom['body'] = preg_replace_callback('/<img(?<pre>[^>]*)src="(?:https?:)?(?:\/\/[^\/]+?)?(?<src>\/[^"]+\.svg)"(?<post>[^>]*?)[\s\/]*>(?!\s*<\/picture>)/s', function(array $match): string { // ^[/] |
|
93 | 93 | if (!isset($this->svgFileArr[$match['src']])) { // check usage |
94 | 94 | return $match[0]; |
95 | 95 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | }, $dom['body']); |
100 | 100 | |
101 | 101 | // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object#attributes |
102 | - $dom['body'] = preg_replace_callback('/<object(?<pre>[^>]*)data="(?<data>\/[^"]+\.svg)"(?<post>[^>]*?)[\s\/]*>(?:<\/object>)/s', function (array $match): string { // ^[/] |
|
102 | + $dom['body'] = preg_replace_callback('/<object(?<pre>[^>]*)data="(?<data>\/[^"]+\.svg)"(?<post>[^>]*?)[\s\/]*>(?:<\/object>)/s', function(array $match): string { // ^[/] |
|
103 | 103 | if (!isset($this->svgFileArr[$match['data']])) { // check usage |
104 | 104 | return $match[0]; |
105 | 105 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | // }, $svg); |
153 | 153 | |
154 | 154 | // https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg#attributes |
155 | - $svg = preg_replace_callback('/([^>]*)\s*(?=>)/s', function (array $match) use (&$attr): string { |
|
155 | + $svg = preg_replace_callback('/([^>]*)\s*(?=>)/s', function(array $match) use (&$attr): string { |
|
156 | 156 | if (false === preg_match_all('/(?!\s)(?<attr>[\w\-]+)="\s*(?<value>[^"]+)\s*"/', $match[1], $matches)) { |
157 | 157 | return $match[0]; |
158 | 158 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | |
207 | 207 | $svg = preg_replace_callback( |
208 | 208 | '/<use(?<pre>.*?)(?:xlink:)?href="(?<href>\/.+?\.svg)(?:#[^"]*?)?"(?<post>.*?)[\s\/]*>(?:<\/use>)?/s', |
209 | - function (array $match): string { |
|
209 | + function(array $match): string { |
|
210 | 210 | if (!isset($this->svgFileArr[$match['href']])) { // check usage |
211 | 211 | return $match[0]; |
212 | 212 | } |
@@ -131,17 +131,17 @@ discard block |
||
131 | 131 | if ($this->formatType > 0 && is_string($html)) { |
132 | 132 | $html = $this->formatHtml($html); |
133 | 133 | } |
134 | - if ( is_string($html)) { |
|
134 | + if (is_string($html)) { |
|
135 | 135 | // remove white space after line ending |
136 | 136 | $this->rTrimLines($html); |
137 | 137 | } |
138 | 138 | |
139 | 139 | // recover line-breaks |
140 | - if (Environment::isWindows() && is_string($html) ) { |
|
140 | + if (Environment::isWindows() && is_string($html)) { |
|
141 | 141 | $html = str_replace($this->newline, "\r\n", $html); |
142 | 142 | } |
143 | 143 | |
144 | - return (string)$html; |
|
144 | + return (string) $html; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | '/(<(?:[^<>]+(?:"[^"]*"|\'[^\']*\')?)+>)/', |
185 | 185 | $html, |
186 | 186 | -1, |
187 | - \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY |
|
187 | + \PREG_SPLIT_DELIM_CAPTURE|\PREG_SPLIT_NO_EMPTY |
|
188 | 188 | ); |
189 | 189 | |
190 | 190 | if (false === $htmlArrayTemp) { |