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
Support deep links #8
Comments
We should definitely try to support this, as it seems like a common use case, though I'm not sure specifically what's being proposed by "deep links". If your example URL is included in a markdown { 'https://github.com/davidtheclark/remark-lint-no-dead-urls#readme': { status: 'alive', statusCode: 200 } } Can you clarify what you mean by parsing the HTML? |
@transitive-bullshit However, I’m sure the Use case: I’m writing some specs in markdown, on GitHub. So automatic IDs are generated for each heading. I’m changing headings (so other IDs are going to be used) |
Ahhh, that make sense :) |
This definitely seems like useful functionality. With that being said, I'm not sure how one would do this robustly without adding something like A few ideas on how we could implement this:
In all 3 options, we could encapsulate this functionality into a separate module, Thoughts? |
Yeah, I think it would be pretty involved, hence my idea for another project. My use case is remark (or rehype), of course, but it makes sense to build an underlying thing of course, like All your proposals make sense to me! |
I agree that this would be very useful. Using rehype to parse HTML and look for matching headings seems reasonable to me, and Parsing static HTML would work great for the use cases I'd have in mind and would avoid all the complexity of puppeteer. If the rationale for puppeteer is that sometimes JS might insert headings, doesn't that situation introduce other problems — like, the browser won't end up deep linking anyway because the heading is not present in the static HTML? |
I’m not sure if it should be in this project (or in
check-links
), but maybe it’s of interest for something to support URLs like:As in, parse the HTML and check if there’s an element with an
id
attribute set toreadme
.Wondering what you think, @davidtheclark / @transitive-bullshit!
The text was updated successfully, but these errors were encountered: