docusaurus-lunr-search icon indicating copy to clipboard operation
docusaurus-lunr-search copied to clipboard

Search result doesn't have URI fragment link

Open jmthomas opened this issue 9 months ago • 1 comments

I'm using docusaurus and this plugin on our site: https://docs.openc3.com/docs. Search works well but the link always just links to the base page and doesn't add the URI fragment that links to the actual text. For example searching for ID_ITEM will generate a result with a link of https://docs.openc3.com/docs/configuration/telemetry##. The double hashes seem to indicate that the URI fragment wants to be there but it's not.

Our full configuration is here: https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com and the generated site is here: https://github.com/OpenC3/cosmos/tree/main/docs

I'm not doing anything special to configure the plugin. Just added it to the package.json dependencies and to the docusaurus.config.js in the plugins section.

jmthomas avatar May 09 '24 00:05 jmthomas

Hi @jmthomas ,

I also found this bug on our documentation site.

Search a page works as expected, but search by a subheader (h2, h3) in the page doesn't work. I also get double # at the end of the url. For example, if I search by the keyword "downloads", the url will be /dashboard/overview##

I found the incorrect url generated in search-doc.json. Please check the image below:

image

I'm using "docusaurus-lunr-search": "^2.3.2", and swizzled to update the css only.

paolochang avatar May 14 '24 21:05 paolochang