Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use IndexMap isntead of BTreeMap in TOC #267

Merged
merged 1 commit into from
Feb 28, 2024
Merged

Conversation

srv1n
Copy link
Contributor

@srv1n srv1n commented Feb 27, 2024

Replace the use of BTreeMap with IndexMap in TOC.

By default BTreemap is sorted ( in this case by title), so by default get_toc() returns the table of contents sorted alphabetically instead of the order they occur in the document.

For most parsing use cases the order of TOC matters.

Changes are minimal and just use IndexMap instead of BTreeMap.

@J-F-Liu J-F-Liu merged commit 663dd04 into J-F-Liu:master Feb 28, 2024
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants