Mandy-cyber / Markdown-ToC-Generator

Generates and writes in a table of contents for a given markdown file
MIT License
4 stars 8 forks source link

[BUG]: Indentation Error in ToC #1

Closed Mandy-cyber closed 1 month ago

Mandy-cyber commented 1 month ago

Context

Currently, if you run mdtoc on this repository's README.md the generated Table of Contents looks as follows:

image

As you can see, the first few headers are all indented one off the level they should be.

Acceptance Criteria


Happy coding! ❤️ -Mandy

A1r0x commented 1 month ago

This might be an issue with the way the README.md file is formatted. I don't know if this was your intention, but Installation Guide, Usage Instructions, and Example are all being treated as the same heading level in the table of contents, but in the actual markdown, Installation Guide is a Header 2 while the rest are Header 1

Mandy-cyber commented 1 month ago

So the thing is, I want it to be able to work even if the order of levels is weird. This is because a lot of the times i choose heading levels not based on the order they should be in but simply what size I want stuff haha. I still want them to be nested in a way that looks correct. Think I got a fix out though.

Mandy-cyber commented 1 month ago

Accidentally marked this one as hacktoberfest (my bad!). Will be putting up more hacktoberfest issues soon!