@@ 271-286 (lines=16) @@ | ||
268 | * @param Operation $operation |
|
269 | * @param string $cssClass |
|
270 | */ |
|
271 | protected function processInsertOperation($operation, $cssClass) |
|
272 | { |
|
273 | $text = array(); |
|
274 | foreach ($this->newWords as $pos => $s) { |
|
275 | if ($pos >= $operation->startInNew && $pos < $operation->endInNew) { |
|
276 | if ($this->config->isIsolatedDiffTagPlaceholder($s) && isset($this->newIsolatedDiffTags[$pos])) { |
|
277 | foreach ($this->newIsolatedDiffTags[$pos] as $word) { |
|
278 | $text[] = $word; |
|
279 | } |
|
280 | } else { |
|
281 | $text[] = $s; |
|
282 | } |
|
283 | } |
|
284 | } |
|
285 | $this->insertTag( "ins", $cssClass, $text ); |
|
286 | } |
|
287 | ||
288 | /** |
|
289 | * @param Operation $operation |
|
@@ 292-307 (lines=16) @@ | ||
289 | * @param Operation $operation |
|
290 | * @param string $cssClass |
|
291 | */ |
|
292 | protected function processDeleteOperation($operation, $cssClass) |
|
293 | { |
|
294 | $text = array(); |
|
295 | foreach ($this->oldWords as $pos => $s) { |
|
296 | if ($pos >= $operation->startInOld && $pos < $operation->endInOld) { |
|
297 | if ($this->config->isIsolatedDiffTagPlaceholder($s) && isset($this->oldIsolatedDiffTags[$pos])) { |
|
298 | foreach ($this->oldIsolatedDiffTags[$pos] as $word) { |
|
299 | $text[] = $word; |
|
300 | } |
|
301 | } else { |
|
302 | $text[] = $s; |
|
303 | } |
|
304 | } |
|
305 | } |
|
306 | $this->insertTag( "del", $cssClass, $text ); |
|
307 | } |
|
308 | ||
309 | /** |
|
310 | * @param Operation $operation |
|
@@ 411-426 (lines=16) @@ | ||
408 | /** |
|
409 | * @param Operation $operation |
|
410 | */ |
|
411 | protected function processEqualOperation($operation) |
|
412 | { |
|
413 | $result = array(); |
|
414 | foreach ($this->newWords as $pos => $s) { |
|
415 | ||
416 | if ($pos >= $operation->startInNew && $pos < $operation->endInNew) { |
|
417 | if ($this->config->isIsolatedDiffTagPlaceholder($s) && isset($this->newIsolatedDiffTags[$pos])) { |
|
418 | ||
419 | $result[] = $this->diffIsolatedPlaceholder($operation, $pos, $s); |
|
420 | } else { |
|
421 | $result[] = $s; |
|
422 | } |
|
423 | } |
|
424 | } |
|
425 | $this->content .= implode( "", $result ); |
|
426 | } |
|
427 | ||
428 | /** |
|
429 | * @param string $text |