-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add a way for them to inject their camo images #96
Conversation
Well, you were first! But this solves proxying of images with absolute URLs, but not images with relative URLs. So at minimum it'd be good to have it as a preprocessing step, so it can see relative image URLs. |
If your URL base is I'm basically imagining URL processing as a pipeline, where the first step converts relative URLs to absolute ones, and the second step (which, since it happens after URL resolution, can be simplified to only deal with absolute URLs) converts direct image URLs to camo image URLs. If it doesn't work for your needs, though, we can probably just merge both 😄 |
I'm rendering readmes from GitHub, so my URL base is So if the base URL is applied first, I'll have to strip it later when deciding how to handle images. In your PR I like the idea of it being a generic attribute tranformer. There's no need to limit it to URLs. |
Good point. Let's merge both, then. |
I've renamed |
97: Context-sensitive relative URL rewrite r=notriddle a=kornelski Similar to #96, but with a critical difference that this is a preprocessing step, before relative URLs are resolved. This allows different relative URLs for images than links. I've named it `url_filter_map`, after a similar iterator filter in std. I've opted for storing callback directly rather than via trait, but this required a custom `Debug`, since `derive` couldn't skip the callback. Co-authored-by: Kornel <kornel@geekhood.net>
Fixes #95