-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Ignore hash (headings) in links to images even in references #76
Conversation
Hey! Previously you talked about images. Why would you have the same use case, but only for links with explicit extensions? For image nodes, as in your previous PR, I think it makes more sense: folks aren’t putting markdown or HTML files or so in an image |
Hey, my use case it to use reference links in images: ![image][image-link]
[image-link]: ./examples/image.jpg#screenshot This is a use case in the VuePress v1, which is able to set
Because in previous use case, we used inline links in images, and now we need to use links to images stored in references. Unfortunately the link in reference could be used both in images (
Yes, you are right. I've done the implementation for a happy path (a typical usage?), when someone puts an extensions of image at the end, that typically means, that it is an image. So now, I have doubts if my PR makes sense because of the ambiguity of references - we cannot determine where they are used until we do not check all reference usages. I think, if the reference link is used only as images I'm going to check some alternatives to simply get rid of using |
We could indeed only apply some behavior to definitions, and then check whether image or link references, reference the definition 🤔 And in the case of both, choose either. Hmmmm |
If something is used in an image src, it's very likely an image and not a markdown or html document, whether it's also used as a link too or not. I think I like that fact better than checking extensions |
I've just discovered, that there is a plugin for Markdown parser that we use, that allows us to apply classes to images without need to use hashes in links. This will be the cleanest solution for us, so I'm going to close this PR, because, as you write - there will be need to implement this in another way, by checking references usage. Thanks for your involvement! |
This comment has been minimized.
This comment has been minimized.
Reopening, in case you have some further comments. You can close it anyway :) |
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #76 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 12 12
Lines 883 924 +41
=========================================
+ Hits 883 924 +41
☔ View full report in Codecov by Sentry. |
OK if there’s no clear use case, I’ll close this for now. |
Initial checklist
Description of changes
Hi!
The purpose of this feature is to fulfil the following requirement:
When linting image paths in references, hashes should be ignored.
This is follow-up for the PR merged a few years ago: #60
In that PR, I've implemented ignoring hashes in image paths written inline, but now we want to use separate references to images in our project and linter complains about these paths:
In my PR #60 I've explained why hashes could be ignored in image paths.
I'm open to a discussion and looking forward for a reply :)