From b42039567d5e00b5ebac12048f4d0d2699f4c867 Mon Sep 17 00:00:00 2001 From: Jonathan Hefner Date: Thu, 28 Dec 2023 12:06:23 -0600 Subject: [PATCH] Fix module_breadcrumbs when parent is a class `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`. --- lib/sdoc/helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sdoc/helpers.rb b/lib/sdoc/helpers.rb index 7a1bbb37..54bdd35d 100644 --- a/lib/sdoc/helpers.rb +++ b/lib/sdoc/helpers.rb @@ -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