Skip to content

Commit

Permalink
Fix module_breadcrumbs when parent is a class
Browse files Browse the repository at this point in the history
`RDoc::Store#find_module_named` does not find classes (though
`RDoc::TopLevel#find_module_named` and `RDoc::Context#find_module_named`
both do).  Thus, prior to this commit, when a parent module was a class,
its breadcrumb would not be linked.

This commit fixes the issue by changing `RDoc::Store#find_module_named`
to `RDoc::Store#find_class_or_module`.
  • Loading branch information
jonathanhefner committed Jan 4, 2024
1 parent 08b4252 commit b420395
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sdoc/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def module_breadcrumbs(rdoc_module)
parent_names = rdoc_module.full_name.split("::")[0...-1]

crumbs = parent_names.each_with_index.map do |name, i|
parent = rdoc_module.store.find_module_named(parent_names[0..i].join("::"))
parent = rdoc_module.store.find_class_or_module(parent_names[0..i].join("::"))
parent ? link_to(h(name), parent) : h(name)
end

Expand Down

0 comments on commit b420395

Please sign in to comment.