File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -728,10 +728,12 @@ export default class RapiDoc extends LitElement {
728
728
// On first time Spec load, try to navigate to location hash if provided
729
729
const locationHash = window . location . hash ?. substring ( 1 ) ;
730
730
if ( locationHash ) {
731
+ const regEx = new RegExp ( `^${ this . routePrefix } ` , 'i' ) ;
732
+ const elementId = window . location . hash . replace ( regEx , '' ) ;
731
733
if ( this . renderStyle === 'view' ) {
732
- this . expandAndGotoOperation ( locationHash , true , true ) ;
734
+ this . expandAndGotoOperation ( elementId , true , true ) ;
733
735
} else {
734
- this . scrollTo ( locationHash ) ;
736
+ this . scrollTo ( elementId ) ;
735
737
}
736
738
} else if ( this . renderStyle === 'focused' ) {
737
739
const defaultElementId = this . showInfo ? 'overview' : this . resolvedSpec . tags [ 0 ] ?. paths [ 0 ] ;
You can’t perform that action at this time.
0 commit comments