gabrielcsapo / docusaurus-plugin-search-local

An offline/local search plugin for Docusaurus v2
https://gabrielcsapo.github.io/docusaurus-plugin-search-local/
MIT License
25 stars 9 forks source link

Fixing links to search results if hash is present #81

Closed dima closed 1 day ago

dima commented 5 months ago

For some reason my search index after docusaurus build contains u and h that are the same except h also has a hash, so the following code will always produce wrong links for any search result that's a deep link. The fix resolves the problem.

{"i":4,"t":"Introduction","u":"/blog/2024/05/01/xyz","h":"/blog/2024/05/01/xyz#introduction","p":2}

The original code makes sense if the search-index.json h entry would only contain the hash and nothing else but that's not what I get. Please review and let me know if there's some other configuration setting that fixes this.

razzeee commented 4 months ago

I think we're also seeing this at https://docs.flathub.org/