Skip to content

<details> not considered for search results #510

@CSC-Sendance

Description

@CSC-Sendance

Hi,

We make relatively heavy use of the <details> tag (see w3schools) even in a nested fashion, e.g.:

<details>
<summary>
heading 1
</summary>
    <details>
        <summary>heading 2 that only is visible when heading 1 was clicked.</summary>
        <p>
       contents that are only visible when heading 1 and then heading 2 were clicked.
        </p>
    </details>
</details>

even after cleaning and building the docusaurus build, it appears only top level details summaries (i.e. heading 1) are included in the search results. No contents or heading2s etc. are considered in the search results.

I inspected the HTML for a bit and the contents are in the HTML defined already, even without collapsing.

Any ideas on how to resolve this (beyond not using the details tag) or is it a bug?

package-lock.json

      "dependencies": {
        "@docusaurus/core": "^3.7.0",
        "@docusaurus/preset-classic": "^3.7.0",
        "@easyops-cn/docusaurus-search-local": "^0.46.1",
        "@fontsource/manrope": "5.0.20",
        "@iconify/react": "^5.2.0",
        "@mdx-js/react": "3.0.1",
        "clsx": "2.1.1",
        "prism-react-renderer": "2.3.1",
        "react": "18.3.1",
        "react-dom": "18.3.1",
        "react-helmet-async": "^2.0.5"
      },

docusaurus.config.ts

  themes: [
    [
      "@easyops-cn/docusaurus-search-local",
      {
        hashed: true,
        indexPages: true,
        language: ["en"],
        highlightSearchTermsOnTargetPage: true,
        explicitSearchResultPath: true,
      },
    ],
  ],

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions