Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: normalize HOL heading entry names
Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>
  • Loading branch information
kantorcodes committed Feb 24, 2026
commit adacc21692342868a88e8926879c65600fe4aa41
10 changes: 8 additions & 2 deletions lib/docs/filters/hol/entries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def include_default_entry?
def get_name
heading = at_css('h1')
return super if heading.nil?
heading.content.gsub(/\s+/, ' ').strip
normalized_heading_text(heading)
end

def get_type
Expand All @@ -21,7 +21,7 @@ def additional_entries
return [] if root_page?

css('h2[id], h3[id]').each_with_object([]) do |node, entries|
section_name = node.content.gsub(/\s+/, ' ').strip
section_name = normalized_heading_text(node)
next if section_name.empty?
next if section_name == name
entries << ["#{name}: #{section_name}", node['id']]
Expand All @@ -30,6 +30,12 @@ def additional_entries

private

def normalized_heading_text(node)
fragment = node.dup
fragment.css('a').remove
fragment.content.gsub(/\s+/, ' ').strip
end

def standards_sdk_doc?
slug.start_with?('libraries/standards-sdk/')
end
Expand Down