| @@ 194-207 (lines=14) @@ | ||
| 191 | * |
|
| 192 | * @return false|string |
|
| 193 | */ |
|
| 194 | protected function isOpeningIsolatedDiffTag($item, $currentIsolatedDiffTag = null) |
|
| 195 | { |
|
| 196 | $tagsToMatch = $currentIsolatedDiffTag !== null |
|
| 197 | ? array($currentIsolatedDiffTag => $this->config->getIsolatedDiffTagPlaceholder($currentIsolatedDiffTag)) |
|
| 198 | : $this->config->getIsolatedDiffTags(); |
|
| 199 | $pattern = '#<%s(\s+[^>]*)?>#iU'; |
|
| 200 | foreach ($tagsToMatch as $key => $value) { |
|
| 201 | if (preg_match(sprintf($pattern, $key), $item)) { |
|
| 202 | return $key; |
|
| 203 | } |
|
| 204 | } |
|
| 205 | ||
| 206 | return false; |
|
| 207 | } |
|
| 208 | ||
| 209 | protected function isSelfClosingTag($text) |
|
| 210 | { |
|
| @@ 220-233 (lines=14) @@ | ||
| 217 | * |
|
| 218 | * @return false|string |
|
| 219 | */ |
|
| 220 | protected function isClosingIsolatedDiffTag($item, $currentIsolatedDiffTag = null) |
|
| 221 | { |
|
| 222 | $tagsToMatch = $currentIsolatedDiffTag !== null |
|
| 223 | ? array($currentIsolatedDiffTag => $this->config->getIsolatedDiffTagPlaceholder($currentIsolatedDiffTag)) |
|
| 224 | : $this->config->getIsolatedDiffTags(); |
|
| 225 | $pattern = '#</%s(\s+[^>]*)?>#iU'; |
|
| 226 | foreach ($tagsToMatch as $key => $value) { |
|
| 227 | if (preg_match(sprintf($pattern, $key), $item)) { |
|
| 228 | return $key; |
|
| 229 | } |
|
| 230 | } |
|
| 231 | ||
| 232 | return false; |
|
| 233 | } |
|
| 234 | ||
| 235 | /** |
|
| 236 | * @param Operation $operation |
|