Skip to content

Commit fe1913b

Browse files
usmanjschroed91
authored andcommitted
before combining table and specialscripts
1 parent 443ed73 commit fe1913b

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

lib/Caxy/HtmlDiff/HtmlDiff.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,23 @@ protected function processInsertOperation($operation, $cssClass)
203203
{
204204
$text = array();
205205
foreach ($this->newWords as $pos => $s) {
206+
$matchFound = false;
206207
if ($pos >= $operation->startInNew && $pos < $operation->endInNew) {
207-
if ($s === '[[REPLACE_TABLE]]' && isset($this->newTables[$pos])) {
208+
209+
foreach ($this->specialElements as $specialElement) {
210+
if($s === $specialElement && isset($this->newSpecialScript[$pos]) && $matchFound === false) {
211+
foreach ($this->newSpecialScript[$pos] as $word) {
212+
$text[] = $word;
213+
}
214+
$matchFound = true;
215+
}
216+
}
217+
if ($s === '[[REPLACE_TABLE]]' && isset($this->newTables[$pos]) && $matchFound === false) {
208218
foreach ($this->newTables[$pos] as $word) {
209219
$text[] = $word;
210-
}
211-
} else {
220+
}
221+
$matchFound = true;
222+
} else if($matchFound === false){
212223
$text[] = $s;
213224
}
214225
}

0 commit comments

Comments
 (0)