Skip to content

Commit 1d8674a

Browse files
committed
Skip the same of outside of nested namespace
In the code below, the fullname of A::B is A::B, but it's treated as A::A::A::B now. module A class A::B end end This commit fixes it.
1 parent a27fecf commit 1d8674a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/rdoc/parser/ruby.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,11 @@ def get_class_or_module container, ignore_constants = false
376376
unless :on_const == name_t[:kind] || :on_ident == name_t[:kind]
377377
raise RDoc::Error, "Invalid class or module definition: #{given_name}"
378378
end
379-
given_name << '::' << name_t[:text]
379+
if prev_container == container and !ignore_constants
380+
given_name = name_t[:text]
381+
else
382+
given_name << '::' << name_t[:text]
383+
end
380384
end
381385

382386
skip_tkspace false

0 commit comments

Comments
 (0)