diff --git a/material/partials/nav-item.html b/material/partials/nav-item.html index 8d09de180..c3e0b51ba 100644 --- a/material/partials/nav-item.html +++ b/material/partials/nav-item.html @@ -30,7 +30,7 @@
  • {% set toc_ = page.toc %} - {% if toc_ | first is defined %} + {% if toc_ | first is defined and "\x3ch1 id=" in page.content %} {% set toc_ = (toc_ | first).children %} {% endif %} {% if toc_ | first is defined %} diff --git a/src/partials/nav-item.html b/src/partials/nav-item.html index 1a39b51dd..07f6eee0c 100644 --- a/src/partials/nav-item.html +++ b/src/partials/nav-item.html @@ -71,7 +71,7 @@ type="checkbox" id="toc" /> - {% if toc_ | first is defined %} + {% if toc_ | first is defined and "\x3ch1 id=" in page.content %} {% set toc_ = (toc_ | first).children %} {% endif %}