File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
lib/rdoc/generator/template/aliki/js Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff 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 */
181181function 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 * ) * ) \. ( h t m l | m d | r d o c ) $ / ) ;
185+ // In some cases, there may be no file extensions
186+ const match = path . match ( / \/ ( [ A - Z ] \w * (?: \/ [ A - Z ] \w * ) * ) ( \. ( h t m l | m d | r d o c ) ) ? $ / ) ;
187187
188188 if ( ! match ) return null ;
189189
You can’t perform that action at this time.
0 commit comments