File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -178,15 +178,15 @@ export function hashIntegration() {
178
178
go : delta => window . history . go ( delta ) ,
179
179
renderPath : path => `#${ path } ` ,
180
180
parsePath : str => {
181
+ // Get everything after the `#` (by dropping everything before the `#`)
181
182
const to = str . replace ( / ^ .* ?# / , "" ) ;
182
- // Hash-only hrefs like `#foo` from plain anchors will come in as `/#foo` whereas a link to
183
- // `/foo` will be `/#/foo`. Check if the to starts with a `/` and if not append it as a hash
184
- // to the current path so we can handle these in-page anchors correctly.
185
183
if ( ! to . startsWith ( "/" ) ) {
184
+ // We got an in-page heading link.
185
+ // Append it to the current path to maintain correct browser behavior.
186
186
const [ , path = "/" ] = window . location . hash . split ( "#" , 2 ) ;
187
187
return `${ path } #${ to } ` ;
188
188
}
189
- return to ;
189
+ return to ; // Normal SolidStart <A> link
190
190
}
191
191
}
192
192
) ;
You can’t perform that action at this time.
0 commit comments