-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
zimcheck fails to locate existing entries where a path segment contains a trailing dot #438
Comments
I may have found the cause: Call stack: In the call to normalize_link, there is a block that checks looks for "./" and skips over those characters. Given the error shows the "./" being skipped over in the before and after, I believe this is the most likely cause.
|
Thank you for looking into this @ThisIsFineTM. The linked code segment contains a comment I've just run another test, this time also adding an article Proposed fix: Adjust lines 423 and 435 in the code snippet linked by @ThisIsFineTM to ensure dots (both single and double occurences) only get resolved as relative path segments if they are the only characters in the current path segment (e.g. resolve them in |
It's both just edge cases with the manual path handling. I'm going to be putting an issue together for changing out the manual path handling with std::filesystem if we can get the maintainers' approval for using c++17 features. |
So, this is probably an edge case, but if a ZIM contains the path
test/a/b./c/
and another entry links to it via<a href="../../test/a/b./c/>...</a>
, thenzimcheck
fails with the message[ERROR] Invalid internal links found:
. The exact message (see below) hints that the path was not properly resolved.General informations
Steps to reproduce
First, create a ZIM with the following minimal example (a quick modification of the python-libzim example):
Then, run
zimcheck test.zim
. This results in the output:As you can see, the link mentioned above gets wrongly converted. When serving the ZIM using
kiwix-serve
, the links work perfectly.Potential cause
After some initial search, I've found a couple of questions on stackoverflow discussing other occurences where paths with such dots were handled weirdly. The responses commented that such paths are handled differently on windows due to some windows naming convention (NOTE: tests performed on debian). Perhaps some library handles ZIM paths similary despite not being windows paths?
The text was updated successfully, but these errors were encountered: