johansatge / obsidian-automatic-table-of-contents

πŸ’  An Obsidian plugin to create a table of contents in a note, that updates itself when the note changes
MIT License
128 stars 12 forks source link

Add nested ordered list option #42

Closed bjtho08 closed 3 months ago

bjtho08 commented 4 months ago

This PR fulfills the feature requested in #41

johansatge commented 4 months ago

Hi

Thanks a lot for this contribution, looks like a great new option πŸ™

We might need to add new unit tests; let me know if you want to do it yourself in this PR; otherwise I can also merge it and add a few myself before releasing a new version of the plugin.

Thanks!

bjtho08 commented 4 months ago

I actually have less than 30 minutes of experience with coding in js, so I might not be the right person to write new unit tests 🀣

This was just an experiment to see if I could do it myself by looking at how you had done the rest and taking advantage of AI auto-complete in VS Code πŸ˜‰

But if you can specify what tests need to be added, I'm willing to give it a go myself. But, if you think it has to be done soonℒ️, then maybe it's better that you do it yourself πŸ˜„

johansatge commented 3 months ago

Thanks! Merged and updated a bit as I just discovered you can always put 1. as prefix (instead of the real number) to generate ordered lists, which makes the code simpler

Test looks like this: https://github.com/johansatge/obsidian-automatic-table-of-contents/pull/45/files