Re: minor issue with highlighting URLs in plain text emal



Hello all,

On 2018.07.03 15:27, Peter Bloomfield wrote:
On 07/03/2018 01:52:12 PM Tue, Albrecht Dreß wrote:
Am 03.07.18 19:25 schrieb(en) Jack via balsa-list:
I recently received an email with the text

Thank you for contacting the office of Congressman Joe Courtney. Due to large amounts of spam and fraudulent emails this account is not monitored. To ensure messages receive the Congressman's attention we ask that you share your thoughts through his website at https://courtney.house.gov/contact/email. Thank you.

and Balsa nicely turned the URL into a link. Unfortunately, it included the ending period in the URL, which led to a 404 not found error, which I originally blamed on the sender, before realizing that it couldn't be their fault, since there is no markup in the plain text.

I must admit that I also stumbled into this issue from time to time, but never cared. I'll look into that, should be easy to fix.

Me too! It seems to be a valid URI *with* the period, and some examples have been seen in the wild. For example <URL:https://stackoverflow.com/questions/12092010/is-it-possible-to-create-a-uri-that-ends-with-a-period>, where software that silently *drops* the trailing period was causing problems. Balsa uses gtk_show_uri_on_window(), which gives an error on 'failure' that Balsa reports to the user. I've never seen such a report, so apparently a 404 is not a 'failure'.
I note that URI does NOT actually end in a period :-)
It could be a valid URI with or without the period. The question is which do you present to the user if the URI is not quoted in any way in the source, and the trailing period might be part of the URI or just ending punctuation? If it's in quotes or angle brackets, I certainly would NOT drop the period. However, if it's white space before the HTTP or HTTPS then I'd expect white space at the end, with the exception that I'd take any trailing punctuation mark as such, and not part of the URI itself. Too bad you can't give the user the choice - but it would confuse far more folks than it would help.

Interestingly, there was also no markup of the link in the HTML version, so that version did not show a link, but I'll blame that on whichever library I am currently using for Balsa to display the HTML.

I guess the HTML renderer will show a clickable link if and only if it is a “<a href="…">…</a>” HTML element. Did you check that in the html source?
That HTML had no markup whatsoever. It was exactly the same content as the plain text version. Unfortunately, the folks who sent it are totally clueless, so there's no point in my trying to make them change it in any way.


Cheers,
Albrecht.
I'll try your patch and let you know.

It seems to me that I've seen an HTML renderer that would 'linkify' a URI, but webkit doesn't seem to.

Best,

Peter

Jack


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]