Skip to content

refactor(toc): Use Map instead of object#270

Merged
vnphanquang merged 4 commits into
vnphanquang:mainfrom
nicholascostadev:refactor/toc-use-map-instead-of-object
Jan 12, 2024
Merged

refactor(toc): Use Map instead of object#270
vnphanquang merged 4 commits into
vnphanquang:mainfrom
nicholascostadev:refactor/toc-use-map-instead-of-object

Conversation

@nicholascostadev
Copy link
Copy Markdown
Contributor

fixes #269

There is a problem with numeric headers not being correctly ordered on the table of contents, a solution I found was to use a Map instead of an object. I don't know if it's an issue that you guys want to have solved, but I'm having a problem with it in my project.

This PR changes the implementation to use a Map, and also changes the docs to the new way of rendering.

Changes

  1. Changed types of items, to be a Map<string, TocItem>.
  2. Changed the implementation to use Map instead of an object.
  3. Updated the docs with the new way of rendering the toc.

@vnphanquang vnphanquang force-pushed the refactor/toc-use-map-instead-of-object branch from 639b571 to fb386d9 Compare January 12, 2024 03:20
@vnphanquang
Copy link
Copy Markdown
Owner

rebase with main, some clean up & changeset. Thanks a lot for the help!

@vnphanquang vnphanquang merged commit a49ca6c into vnphanquang:main Jan 12, 2024
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.

Generated table of contents does not reflect on header order if it is a number

2 participants