Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML indexes, but not deep linking #350

Open
tiltos opened this issue Sep 25, 2023 · 0 comments
Open

HTML indexes, but not deep linking #350

tiltos opened this issue Sep 25, 2023 · 0 comments

Comments

@tiltos
Copy link

tiltos commented Sep 25, 2023

Overall, this is a great plugin.
I've got a bit of an issue though. It appears that search can index html fine (including that in mdx files), however it cannot deep-link to it.

For example, ``/docs/hello` :

## Parent heading

content here

<h3>example</h3>

The expected behaviour result in this example is to link to the parent heading (/docs/hello#parent-heading). This is how normal markdown is linked, as IDs (anchor links) are generated by docusaurus.

The current behaviour is the result links to /docs/hello.

Ideally, if I attach an id to the html heading, eg <h3 id="example">example</h3>, then the search would be able to index that ID and link directly to it (/docs/hello#example).

I realise that headings are treated slightly differently, but basically I want the index to populate the h if it exists on the element. Here's what currently happens in the index:

      {
        "i": 2236,
        "t": "example",
        "u": "/docs/hello/",
        "h": "",
        "p": 2222
      },
      {
        "i": 2240,
        "t": "Parent heading",
        "u": "/docs/hello",
        "h": "#parent-heading",
        "p": 2238
      },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant