Skip to content

Commit db02096

Browse files
committed
Allowing no filename suffix cases
1 parent 0205a6e commit db02096

File tree

1 file changed

+5
-5
lines changed
  • lib/rdoc/generator/template/aliki/js

1 file changed

+5
-5
lines changed

lib/rdoc/generator/template/aliki/js/aliki.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,15 @@ function hookSearch() {
175175
* Extract module/class name from URL path
176176
*
177177
* Examples:
178-
* /RDoc/String.html -> String
179-
* /RDoc/String/Example.html -> String::Example
178+
* /_site/String.html -> String
179+
* /_site/String/Example.html -> String::Example
180180
*/
181181
function getCurrentModuleName() {
182182

183-
const path = window.location.pathname;
183+
const path = window.location.pathname; // Ignore the fragment
184184

185-
// Match patterns like /RDoc/ClassName.html or /RDoc/ClassName/SubClass.html
186-
const match = path.match(/\/([A-Z]\w*(?:\/[A-Z]\w*)*)\.(html|md|rdoc)$/);
185+
// In some cases, there may be no file extensions
186+
const match = path.match(/\/([A-Z]\w*(?:\/[A-Z]\w*)*)(\.(html|md|rdoc))?$/);
187187

188188
if (!match) return null;
189189

0 commit comments

Comments
 (0)