diff --git a/resources/views/filament/infolists/entries/normalized-diff.blade.php b/resources/views/filament/infolists/entries/normalized-diff.blade.php index aceaaa5..6daeb07 100644 --- a/resources/views/filament/infolists/entries/normalized-diff.blade.php +++ b/resources/views/filament/infolists/entries/normalized-diff.blade.php @@ -262,32 +262,38 @@ View -
- @php - $count = count($ops); - @endphp +
@php
+$count = count($ops);
 
-                                                                @for ($i = 0; $i < $count; $i++)
-                                                                    @php
-                                                                        $op = $ops[$i];
-                                                                        $next = $ops[$i + 1] ?? null;
-                                                                    @endphp
+for ($i = 0; $i < $count; $i++) {
+    $op = $ops[$i];
+    $next = $ops[$i + 1] ?? null;
+    $type = $op['type'] ?? null;
+    $line = (string) ($op['line'] ?? '');
 
-                                                                    @if ($op['type'] === 'equal')
-{{ $op['line'] }}
-                                                                    @elseif ($op['type'] === 'delete' && is_array($next) && ($next['type'] ?? null) === 'insert')
-- {{ $op['line'] }}
-+ {{ $next['line'] }}
-                                                                        @php
-                                                                            $i++;
-                                                                        @endphp
-                                                                    @elseif ($op['type'] === 'delete')
-- {{ $op['line'] }}
-                                                                    @elseif ($op['type'] === 'insert')
-+ {{ $op['line'] }}
-                                                                    @endif
-                                                                @endfor
-                                                            
+ if ($type === 'equal') { + echo e($line)."\n"; + continue; + } + + if ($type === 'delete' && is_array($next) && ($next['type'] ?? null) === 'insert') { + echo '- '.e($line)."\n"; + echo '+ '.e((string) ($next['line'] ?? ''))."\n"; + $i++; + continue; + } + + if ($type === 'delete') { + echo '- '.e($line)."\n"; + continue; + } + + if ($type === 'insert') { + echo '+ '.e($line)."\n"; + continue; + } +} +@endphp @else