@@ 203-216 (lines=14) @@ | ||
200 | * |
|
201 | * @return false|string |
|
202 | */ |
|
203 | protected function isOpeningIsolatedDiffTag($item, $currentIsolatedDiffTag = null) |
|
204 | { |
|
205 | $tagsToMatch = $currentIsolatedDiffTag !== null |
|
206 | ? array($currentIsolatedDiffTag => $this->config->getIsolatedDiffTagPlaceholder($currentIsolatedDiffTag)) |
|
207 | : $this->config->getIsolatedDiffTags(); |
|
208 | $pattern = '#<%s(\s+[^>]*)?>#iUu'; |
|
209 | foreach ($tagsToMatch as $key => $value) { |
|
210 | if (preg_match(sprintf($pattern, $key), $item)) { |
|
211 | return $key; |
|
212 | } |
|
213 | } |
|
214 | ||
215 | return false; |
|
216 | } |
|
217 | ||
218 | protected function isSelfClosingTag($text) |
|
219 | { |
|
@@ 229-242 (lines=14) @@ | ||
226 | * |
|
227 | * @return false|string |
|
228 | */ |
|
229 | protected function isClosingIsolatedDiffTag($item, $currentIsolatedDiffTag = null) |
|
230 | { |
|
231 | $tagsToMatch = $currentIsolatedDiffTag !== null |
|
232 | ? array($currentIsolatedDiffTag => $this->config->getIsolatedDiffTagPlaceholder($currentIsolatedDiffTag)) |
|
233 | : $this->config->getIsolatedDiffTags(); |
|
234 | $pattern = '#</%s(\s+[^>]*)?>#iUu'; |
|
235 | foreach ($tagsToMatch as $key => $value) { |
|
236 | if (preg_match(sprintf($pattern, $key), $item)) { |
|
237 | return $key; |
|
238 | } |
|
239 | } |
|
240 | ||
241 | return false; |
|
242 | } |
|
243 | ||
244 | /** |
|
245 | * @param Operation $operation |