I am using DiscoTOC for a long time, and it works fine with Chinese headings until recent update.
If there are multiple Chinese headings (including no ascii characters) in the post, it will only navigate to the first heading of one level when the navigation item on the right side is clicked. I believe this is because the DiscoTOC generates navigation items with the same id (because the headings are all in Chinese). So, the query selector will only find the first heading.
As a try, I forked the GitHub repo and pushed a little commit as
It seems to work in my site. If it looks good to you team, I can raise a pull request, or this bug need to be fixed in another way.
First off, this is a super helpful theme component for long posts!
However, thereās an issue with this theme component on mobile devices (at least on iOS). When I open a large table of contents, scrolling through the TOC doesnāt work on mobile like it does on a desktop.
The list contains Headings A-H, but I canāt scroll through it
The list appears to be scrollable, but a touchstart event prevents the list from being scrolled. Disabling the touch start event listener for the d-toc element seems to solve the issue.
I canāt see the version of the theme component we have on our forum, nor can I test this on a local install (since I canāt load it on a phone). So, if there is a fix Iām not aware of or if thereās anything I should, please let me know.
@pmusaraj I guess itās possible that I havenāt set this correctly but I have installed the theme and the TOC I set up on a topic is not appearing on the discourse-docs version but it is appearing in the main topic
The next time you update DiscoTOC youāll probably notice that weāve added a button to toggle between the topic timeline and the table of contentsā¦ let us know if you encounter any issues or have feedback about this new feature!
Iāve just made a minor update to this theme that ignores the trust level requirement for staff accounts, this more closely follows how Discourseās settings behave.