New Test Version
2024-08-06
- Keep order of non-anchor TOC entries to the same file.
- Update Translations
Hmmm.

I think I see what's going on here, but without seeing the source epub, I'm speculating a bit.
TOC entries can point to an HTML file in general, or a specific anchor tag inside an HTML file.
The code that collects multiple TOC entries pointing to the same HTML file specifically puts file-pointing entries at the start of the list to make sure they 'win' if there are anchor-pointing entries to the same HTML file in the TOC before the file-pointing entries. (A TOC is not required to be linear.)
This had the unintended affect of reversing the order when there's more than one TOC entry pointing to the same HTML file without anchors.
The attached test version addresses that issue. If it doesn't fix your (sptau's) problem, I'll need to see the source epub.