We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ec63fd commit 9ca376aCopy full SHA for 9ca376a
1 file changed
app/lib/toc_generator.rb
@@ -45,7 +45,7 @@ def parse_and_transform
45
parsed_html.traverse do |node|
46
next unless TARGET_ELEMENTS.include?(node.name)
47
48
- anchor = node['id'] || node.text.parameterize
+ anchor = node['id'] || node.text.parameterize.presence || 'sec'
49
@slugs[anchor] += 1
50
anchor = "#{anchor}-#{@slugs[anchor]}" if @slugs[anchor] > 1
51
0 commit comments