also pass the uri as %u to external handlers #58
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Most if not all browsers allow viewing an image by itself. When they do, they show the image url in the address bar. The corresponding operation in elinks is to open the image with an external handler. Many image viewers show or let the user show the image name, but this is the name of the temporary file elinks downloaded the image to, not the uri. Some image viewers accept an image title to be shown instead or in addition to the file name: feh has the --info option, gwenview has --title, fbv has -n. Passing the image uri makes them produce the expected behaviour.
This commit changes the format of the handler string: %u stands for the uri, in addition to %f for the local file name. The old syntax is still accepted since % followed by space or the end of the string is replaced by the file name. The commit also allows
%%
to mean an actual percent symbol, which was previously impossible.In case of images also passing the
alt
tag would make sense, but I believe that would be complicated because it requires passing the content of that tag around until the point where the handler string is substituted.