- Issue created by @flocondetoile
- 🇫🇷France mably
You're right, we should properly handle the case when headings are not real HTML headings (h1, h2, ...).
Will work on a fix.
- Assigned to mably
- Issue was unassigned.
- 🇫🇷France flocondetoile Lyon
Yes thanks
as a dirty fix, this resolve the case
diff --git a/assets/js/tocjs.js b/assets/js/tocjs.js index 443728a7cf..7c3af11e05 100644 --- a/assets/js/tocjs.js +++ b/assets/js/tocjs.js @@ -385,6 +385,15 @@ lastLi = li; currentLevel = level; } + else { + const ul = document.createElement(opts.listType); + currentLevel = level; + ul.level = level; + ul.appendChild(li); + lastLi.appendChild(ul); + currentList = ul; + lastLi = li; + } }); }
But defaulting to level 1 is good.
- Assigned to mably
- Merge request !28Issue #3474870 by flocondetoile, mably: Nav is empty if selector for heading... → (Merged) created by mably
- Status changed to Needs review
3 months ago 10:03am 17 September 2024 - 🇫🇷France mably
Problem should be fixed. Could you give a try to this issue's MR @flocondetoile?
Here is what I get on my side with DIV headings:
- Status changed to RTBC
3 months ago 10:10am 17 September 2024 - Status changed to Fixed
3 months ago 10:58am 17 September 2024 Automatically closed - issue fixed for 2 weeks with no activity.
- Issue was unassigned.
- Status changed to Fixed
14 days ago 9:30pm 4 December 2024