Comments (6)
To add my two cents here, although I think a README change is probably sufficient, it seems like there could be some type of enhancement that would at least let users know that root-level files were discovered and skipped. Even if that were only shown in a debug or verbose mode, that'd be fine and probably enough to point users in the right direction. My expectation as a user of lychee is that there's some setting which will tell me absolutely every link lychee "saw" and what its disposition is. Even if the --base .
flag isn't set, it's still a genuine link. I'd want to be told what it did or didn't do about it.
from lychee.
Yes, absolutely. Pull requests to lychee-action (and possibly lychee) to clarify the behavior would be very welcome. I'm too involved in the tool creation to make this an easy task for me, as it's kinda obvious by now, but of course that's just Stockholm syndrome. 😆
from lychee.
FYI: moved the issue to the lychee main repo, because it's a better fit there.
from lychee.
Thanks for the thorough analysis.
Yes, --base .
is currently the suggested way. Making it the default would make your case work, but break another case:
If the input is https://example.com
and we find a link such as /about
on that page, we assume it is pointing to https://example.com/about
, which is a sensible assumption.
However, setting --base
to .
by default conflicts with that.
That's because we set the base from the source URL if --base
is not set.
#358
If we change that behavior, we have to track (or infer) whether the source is a directory path or a URL. Sounds straightforward, but there are edge-cases like /about
, which could be either a path or a URL relative to the domain root — depending on the context.
I do think that this can be resolved, it just requires more research and thorough testing to avoid any future surprises. I would love to get some help on this by mapping out all cases and maybe writing some tests.
For now, --base .
avoids any ambiguities, at the cost of false negatives if the parameter isn't used.
from lychee.
Thanks for triaging this mre.
It makes sense that completely ignoring the link is a bug for this repo.
Would it make sense to add some small description to the README of the lychee-action repo so that others are aware they should add --base .
when testing against local files rather than a server? It can be pretty non-obvious when it checks a few hundred links that a few were quietly skipped over.
from lychee.
Fair. As a first step we could print the ignored potential links in verbose mode.
from lychee.
Related Issues (20)
- custom Header not sent HOT 7
- Consider renaming `--format` to `--report` HOT 5
- Comments to ignore links HOT 1
- Consider renaming `fail_map` to `error_map` HOT 3
- Screencast SVG incurs a rendering burden on the browser HOT 1
- Optionally: Collect all URLs and deduplicate them? HOT 3
- Optionally: retrieve titles of pages and URL fragment targets? HOT 3
- Parameter --base does not work on windows HOT 13
- Archive integration with `lychee_lib` HOT 1
- bug: anchor/fragment detection doesn't appear to work HOT 1
- Windows Filepaths With a Drive Specifier Incorrectly Identified as Urls
- Mastodon link is interpreted as email address HOT 1
- ci: inconsistent naming of gh release assets
- Support URL Encoded Anchors
- Convert `StatusCode` to `Status` HOT 3
- Emails resulting in "Failed: Cannot find file" HOT 4
- [macos] release asset lychee-v0.15.1-macos-x86_64.dmg contains only ARM64 executable HOT 6
- Confusing exit 2, although no error visible
- Bug: lychee can not detect error relative url HOT 2
- Bug: unable to check url inside <style> tag and css file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lychee.