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

[mu4e bug] URLs in gnus-view for HTML mails not recognized #2094

Open
3 tasks done
mbunkus opened this issue Aug 18, 2021 · 2 comments
Open
3 tasks done

[mu4e bug] URLs in gnus-view for HTML mails not recognized #2094

mbunkus opened this issue Aug 18, 2021 · 2 comments
Labels
bug mu4e specific for mu4e

Comments

@mbunkus
Copy link

mbunkus commented Aug 18, 2021

Describe the bug

Functions that operate on URLs such as mu4e-view-go-to-url or mu4e-view-save-url fail to find URLs in HTML mails where the displayed text of the <a> element does not contain a URL (href != link text). They do find them if href == link text.

For example:

  • Works: <a href="https://github.com/">https://github.com/</a>
  • Does not work: <a href="https://github.com/">Github</a>

In case 1. the URL is numbered & offered when using mu4e-view-go-to-url. In case 2. it isn't.

To Reproduce

Using the gnus-based view, open any HTML mail that contains links where the link text isn't a URL. Invoke mu4e-view-go-to-url. Observe that the URL isn't numbered, and that you cannot open it.

Environment

Arch Linux
Emacs 27.2
mu+mu4e 1.6.3-1 (Arch Linux package's version number)

Checklist

  • you are running vanilla emacs (i.e. without Doom, Evil, Spacemacs etc.) (otherwise, please try to reproduce without those
  • you are running mu4e without any third-party extensions (otherwise, please try to reproduce without those)
  • you are running either the latest 1.4.x release, or a 1.5.11+ development release (otherwise, please upgrade).
@mbunkus mbunkus added bug mu4e specific for mu4e new labels Aug 18, 2021
@djcb
Copy link
Owner

djcb commented Aug 19, 2021

It's more of an accident that some URLs are "activated" in an HTML mail; we need to turn that off for such messages.

@djcb djcb removed the new label Aug 19, 2021
@mbunkus
Copy link
Author

mbunkus commented Aug 21, 2021

I've implemented two workarounds available here, in case anyone needs something like this.

The first function collects all URLs in the current view buffer from text properties & displays them along with the anchor's text in a read-only buffer. Enables easy clicking on them with the mouse, even if you're running Emacs over ssh, as I do (from Windows via putty). Pressing q will kill the buffer again, returning to the message view. I've bound this function to g.

The second function takes the URL stored in text properties at point and starts a wget process with that URL asynchronously. This natural key bind for this is k, obviously.

Both workarounds are just that; quick hacks that rely on certain conditions (e.g. it only works if the shr renderer is used by gnus for displaying HTML messages, meaning mm-text-html-renderer must be set to 'shr, which is the default nowadays), aren't configurable and definitely not meant to be included in mu4e proper. Just as a small help for others who might need something now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mu4e specific for mu4e
Projects
None yet
Development

No branches or pull requests

2 participants