about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/lib/toc_generator.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/lib/toc_generator.rb b/app/lib/toc_generator.rb
index 351675a5c..0c8f766ca 100644
--- a/app/lib/toc_generator.rb
+++ b/app/lib/toc_generator.rb
@@ -45,7 +45,7 @@ class TOCGenerator
     parsed_html.traverse do |node|
       next unless TARGET_ELEMENTS.include?(node.name)
 
-      anchor = node['id'] || node.text.parameterize
+      anchor = node['id'] || node.text.parameterize.presence || 'sec'
       @slugs[anchor] += 1
       anchor = "#{anchor}-#{@slugs[anchor]}" if @slugs[anchor] > 1