We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a5df5a4 + 1079c37 commit 8f17cf6Copy full SHA for 8f17cf6
src/Nodes/Heading.php
@@ -18,7 +18,10 @@ public function renderHTML($node, $HTMLAttributes = [])
18
19
// Add slugified id to specific headlines.
20
if (in_array($node->attrs->level, config('anchor-navigation.heading.levels', []))) {
21
- $HTMLAttributes['id'] = Str::slug($node->content[0]->text);
+
22
+ if (property_exists($node->content[0], 'text') && !is_null($node->content[0]->text)) {
23
+ $HTMLAttributes['id'] = Str::slug($node->content[0]->text);
24
+ }
25
}
26
27
return [
0 commit comments