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