Search code examples
drop-down-menumarkdowndropdowngithub-flavored-markdownreadme

Nested dropdown in markdown


I want to nest dropdown menus in the following Markdown code but the innermost dropdowns are not "inside" the outermost one. That is, they don't disappear when I click the dropdown button.

<details>
<summary> Year 1 (2021 - 2022) <summary>
  
  <details>
  <summary> Refreshers </summary>
  <ul>
    <li> Algorithmics </li>
    <li> Basic tools </li>
  </ul>
  </details>

  <details>
  <summary> Semester 1 </summary>
  <ul>
    <li> Data Visualization </li>
    <li> Ethics </li>
  </ul>
  </details>
  
</details>

Is there a way to do what I want?
Thanks.


Solution

  • This has nothing to do with Markdown—you just have a typo. You are opening a second <summary> tag instead of closing the first one:

    <details>
    <summary> Year 1 (2021 - 2022) </summary>
    <!--                            ^ this / is missing -->
    ...  
    </details>