Skip to content
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

also pass the uri as %u to external handlers #58

Merged
merged 1 commit into from
Jul 25, 2020
Merged

Conversation

sgerwk
Copy link
Contributor

@sgerwk sgerwk commented Jul 25, 2020

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.

@rkd77 rkd77 merged commit c590c3e into rkd77:master Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants