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

Can I nest h3 below h2 lists? #5

Closed
filip-van-hoeckel opened this issue Feb 11, 2021 · 3 comments
Closed

Can I nest h3 below h2 lists? #5

filip-van-hoeckel opened this issue Feb 11, 2021 · 3 comments

Comments

@filip-van-hoeckel
Copy link

filip-van-hoeckel commented Feb 11, 2021

This is the current code being output
ul>h2,h2,h3
How would we go about?
ul>h2,h2>ul,h3
This enables us to use the active class in order to hide a submenu when the parent is not active.

@psalmody
Copy link
Owner

psalmody commented Feb 11, 2021

I'm not quite following - can you give a short example? The tool doesn't output h2 or h3 tags so I'm not sure what you mean... are you wanting the output to be nested differently? Or is it having trouble picking up one of your headings?

@filip-van-hoeckel
Copy link
Author

Sorry bout that: allow me to demonstrate: #
https://gist.github.com/filip-van-hoeckel/0f37711def15a6fdac9dbc3af985e250

@psalmody
Copy link
Owner

Can you send the javascript code you're using too? When I run the test scenarios I have, the toc matches what you are requesting:

image

See example at: https://github.com/psalmody/html-contents/blob/master/test/index.html

Initializing with:

    document.addEventListener("DOMContentLoaded", function(event) {
      htmlContents('#toc', {
        bottom: 5,
        listType: 'o',
        filter: function(arr) {
          return !arr.matches('.noOutline')
        }
      })
    })

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

No branches or pull requests

2 participants