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() {
178178 go : delta => window . history . go ( delta ) ,
179179 renderPath : path => `#${ path } ` ,
180180 parsePath : str => {
181+ // Get everything after the `#` (by dropping everything before the `#`)
181182 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.
185183 if ( ! to . startsWith ( "/" ) ) {
184+ // We got an in-page heading link.
185+ // Append it to the current path to maintain correct browser behavior.
186186 const [ , path = "/" ] = window . location . hash . split ( "#" , 2 ) ;
187187 return `${ path } #${ to } ` ;
188188 }
189- return to ;
189+ return to ; // Normal SolidStart <A> link
190190 }
191191 }
192192 ) ;
You can’t perform that action at this time.
0 commit comments