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

Headers instead of section divs #97

Closed
edemaine opened this issue Mar 6, 2019 · 4 comments
Closed

Headers instead of section divs #97

edemaine opened this issue Mar 6, 2019 · 4 comments

Comments

@edemaine
Copy link

edemaine commented Mar 6, 2019

Have you considered supporting the use-case of headers (like <h1>, <h2>, etc.) implicitly defining sections (the interval between one header inclusive and the next header exclusive), instead of explicit section <div>s? This seems like a common use-case, e.g., the output of various Markdown translators, and is presumably addable via an option. If there's interest, I may be able to contribute a PR.

@cferdinandi
Copy link
Owner

This would fundamentally change the way the script works today.

The last version had a set up kind of like this, and it was fraught with an accuracy.

I can see the appeal, but I’m worried about implementation

@cferdinandi
Copy link
Owner

Looking at how other jQuery dependent scripts do this, I think you’re right. I’ll see if I can make this happen.

@edemaine
Copy link
Author

edemaine commented Mar 6, 2019

@cferdinandi Great! I don't think it's that hard -- you just need to test for top being above, but not restrict bottom. You may also need to go through the items in order instead of reverse order as you currently do.

In case it's helpful, here's some code I wrote to do this recently (but based on jQuery). That project is hoping to replace this code with Gumshoe.

@cferdinandi
Copy link
Owner

Alright, just added support for this with v5.1.0: https://github.com/cferdinandi/gumshoe/releases/tag/v5.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants