| @@ 280-295 (lines=16) @@ | ||
| 277 | * @param Operation $operation |
|
| 278 | * @param string $cssClass |
|
| 279 | */ |
|
| 280 | protected function processInsertOperation($operation, $cssClass) |
|
| 281 | { |
|
| 282 | $text = array(); |
|
| 283 | foreach ($this->newWords as $pos => $s) { |
|
| 284 | if ($pos >= $operation->startInNew && $pos < $operation->endInNew) { |
|
| 285 | if ($this->config->isIsolatedDiffTagPlaceholder($s) && isset($this->newIsolatedDiffTags[$pos])) { |
|
| 286 | foreach ($this->newIsolatedDiffTags[$pos] as $word) { |
|
| 287 | $text[] = $word; |
|
| 288 | } |
|
| 289 | } else { |
|
| 290 | $text[] = $s; |
|
| 291 | } |
|
| 292 | } |
|
| 293 | } |
|
| 294 | $this->insertTag('ins', $cssClass, $text); |
|
| 295 | } |
|
| 296 | ||
| 297 | /** |
|
| 298 | * @param Operation $operation |
|
| @@ 301-316 (lines=16) @@ | ||
| 298 | * @param Operation $operation |
|
| 299 | * @param string $cssClass |
|
| 300 | */ |
|
| 301 | protected function processDeleteOperation($operation, $cssClass) |
|
| 302 | { |
|
| 303 | $text = array(); |
|
| 304 | foreach ($this->oldWords as $pos => $s) { |
|
| 305 | if ($pos >= $operation->startInOld && $pos < $operation->endInOld) { |
|
| 306 | if ($this->config->isIsolatedDiffTagPlaceholder($s) && isset($this->oldIsolatedDiffTags[$pos])) { |
|
| 307 | foreach ($this->oldIsolatedDiffTags[$pos] as $word) { |
|
| 308 | $text[] = $word; |
|
| 309 | } |
|
| 310 | } else { |
|
| 311 | $text[] = $s; |
|
| 312 | } |
|
| 313 | } |
|
| 314 | } |
|
| 315 | $this->insertTag('del', $cssClass, $text); |
|
| 316 | } |
|
| 317 | ||
| 318 | /** |
|
| 319 | * @param Operation $operation |
|
| @@ 420-435 (lines=16) @@ | ||
| 417 | /** |
|
| 418 | * @param Operation $operation |
|
| 419 | */ |
|
| 420 | protected function processEqualOperation($operation) |
|
| 421 | { |
|
| 422 | $result = array(); |
|
| 423 | foreach ($this->newWords as $pos => $s) { |
|
| 424 | if ($pos >= $operation->startInNew && $pos < $operation->endInNew) { |
|
| 425 | if ($this->config->isIsolatedDiffTagPlaceholder($s) && isset($this->newIsolatedDiffTags[$pos])) { |
|
| 426 | $result[] = $this->diffIsolatedPlaceholder($operation, $pos, $s); |
|
| 427 | } else { |
|
| 428 | $result[] = $s; |
|
| 429 | } |
|
| 430 | } |
|
| 431 | } |
|
| 432 | $this->content .= implode('', $result); |
|
| 433 | } |
|
| 434 | ||
| 435 | /** |
|
| 436 | * @param string $text |
|
| 437 | * @param string $attribute |
|
| 438 | * |
|