File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -290,16 +290,17 @@ const renderer = (title: string) => ({
290290 // Markdown links can point to a specific version of a component,
291291 // e.g. href="/v11_7/DateInput". navigateTo() expects the page
292292 // name and version as separate arguments, so we need to split
293- // them apart. Plain links like "DateInput" are passed through
294- // as-is.
295- const path = href . replace ( / ^ \/ + / , '' ) // "/v11_7/DateInput" -> "v11_7/DateInput"
293+ // them apart. Plain links like "DateInput", "/DateInput", and
294+ // legacy hash-routing links like "/#DateInput" are normalised
295+ // to the bare page name.
296+ const path = href . replace ( / ^ \/ + / , '' ) . replace ( / ^ # + / , '' )
296297 const [ first , second ] = path . split ( '/' )
297298 const isVersionedLink = MINOR_VERSION_REGEX . test ( first ) && second
298299
299300 if ( isVersionedLink ) {
300301 navigateTo ( second , { minorVersion : first } )
301302 } else {
302- navigateTo ( href )
303+ navigateTo ( path || 'index' )
303304 }
304305 } }
305306 >
You can’t perform that action at this time.
0 commit comments