Browse Source

Fix display of headings when append file has a H1

shalvah 2 years ago
parent
commit
4924499dc4
1 changed files with 5 additions and 5 deletions
  1. 5 5
      src/Writing/HtmlWriter.php

+ 5 - 5
src/Writing/HtmlWriter.php

@@ -182,7 +182,7 @@ class HtmlWriter
             }
         }
 
-        $headings = array_merge($headings, array_map(function ($group) {
+        $headings = array_merge($headings, array_values(array_map(function ($group) {
             $groupSlug = Str::slug($group['name']);
 
             return [
@@ -194,7 +194,7 @@ class HtmlWriter
                             'slug' => $endpoint->fullSlug(),
                             'name' => $endpoint->name(),
                             'subheadings' => []
-                        ])->all();
+                        ])->values();
                     }
 
                     return [
@@ -205,12 +205,12 @@ class HtmlWriter
                                 'slug' => $endpoint->fullSlug(),
                                 'name' => $endpoint->name(),
                                 'subheadings' => []
-                            ])->all(),
+                            ])->values(),
                         ],
                     ];
-                })->all(),
+                })->values(),
             ];
-        }, $endpointsByGroupAndSubgroup));
+        }, $endpointsByGroupAndSubgroup)));
 
         $lastL1ElementIndex = null;
         foreach ($headingsAfterEndpoints as $heading) {