-
-
Notifications
You must be signed in to change notification settings - Fork 19
Fix HTML link rewriting and CSS link rewriting #34
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
Conversation
|
Thank you. There a a couple things I don't understand:
|
By greedy I mean, without the ?, the regexp would match the longest match. Say if we have -
Agrees. Updated the main comment and will take care of this in the future
Okay, so rewriting root-relative URLs made the stuff in openedx a bit easier to implement. I did know that root-relative is forbidden in ZIM, but thought that since we are rewriting links anyway, it could help (didn't know libzim is about to drop namespaces). If that's the case then I think I shall handle root-relative in scrapers itself. So, if we chose to drop root-relatives, openzim/openedx#70 wont work at the moment, unless I put another patch. What do you suggest? |
Thanks for pointing that out. I did not expect that. Could you please add such a test then?
I think we should take care of this now. Where are those links coming from btw? Our templates of edx ? |
878e0eb to
111d009
Compare
Codecov Report
@@ Coverage Diff @@
## master #34 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 19 19
Lines 754 757 +3
=========================================
+ Hits 754 757 +3
Continue to review full report at Codecov.
|
|
Pushed some changes to allow external URLs and raise an exception if root-relative URLs are found. |
Hum, I don't see the added value of this. This module's role is to rewrite URLs to handle the namespace stuff. That's it. What you added is a validation check. There are many things that can be checked and that's why zimcheck exists. We don't use zimcheck enough for now but we should use it more while developing scrapers ; that's why we have a ticket to integrate it with zimfarm. I'd prefer we stick to “we rewrite what we know needs rewriting and leave the rest as is”. Also, changelog messages should be more specific here as this project is developer-oriented and the changelog would be first stop for people with an issue to look for answers. |
591a769 to
1de6a8a
Compare
1de6a8a to
c5d7368
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good. Simplified the change a bit
This fixes the following -
Proper rewriting of root-relative links- Dropped as its forbidden in ZIM and shall be handled by scrapers given that we plan to get rid of namespacesAdditional changes -