@for ($i = 0; $i < count($matches); $i++)
{{-- // start lists --}}
@if ($currentDepth != (int) $matches[$i][2])
@for ($currentDepth; $currentDepth < (int) $matches[$i][2]; $currentDepth++)
@php $numberedItems[$currentDepth + 1] = 0; @endphp
@php
$numberedItems[$currentDepth] = 0;
@endphp
@endfor
@endif
@if ($currentDepth == (int) @$matches[$i + 1][2])
@endif
@else
{{-- // this is the last item, make sure we close off all tags --}}
@for ($currentDepth; $currentDepth >= $numberedItemsMin; $currentDepth--)
@if ($currentDepth != $numberedItemsMin) {
@endif
@endfor
@endif
@endfor