Closed Bug 1240418 Opened 8 years ago Closed 8 years ago

Linkify sometimes overzealously inserts a hyperlink into the link text.

Categories

(Core :: Networking, defect)

38 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1274602

People

(Reporter: dlreich, Unassigned)

Details

(Whiteboard: [necko-would-take])

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0
Build ID: 20160105164030

Steps to reproduce:

Click Write to open new email. Insert any To: address and any Subject.  In body, insert 
"reply(test@gmail.com)".  Select "reply" in body, click Insert-Link. In link field enter "Mailto:test@gmail.com?subject=RSVP".  Click OK.  Select "test@gmail.com" in body, click Insert-Link. In link field enter "Mailto:test@gmail.com?subject=RSVP" (i.e same link text). Click OK  Send email.  Open sent email in Sent folder to see what has happened to the two mailto: links.


Actual results:

The mailto: link under "reply" is unchanged but the "mailto: link under "test@gmail.com" no longer includes the "?subject=RSVP" text.


Expected results:

The links should have remained the same as they were entered.
I cannot reproduce this.
When I click Send later and inspect the message in the Outbox, the links seem to be correct. Can you see the problem also in this case? I tested on TB 46, but I am not sure there would be changes in this are between 38-46.
I created a new message containing "reply (dlreich@gmail.com)" and used Insert-Link to create links with link text "mailto:dlreich@gmail.com?subject=subject-text" on both "reply" and "dlreich@gmail.com" I then clicked Send Later and examined the email in Local Folders Outbox using View-Message Source.  Here is the relevant HTML: 
<body bgcolor="#FFFFFF" text="#000000">
    <a href="mailto:dlreich@gmail.com?subject=subject-text">reply</a> (<a
      href="mailto:dlreich@gmail.com?subject=subject-text"><a class="moz-txt-link-abbreviated" href="mailto:dlreich@gmail.com">dlreich@gmail.com</a></a>)<br>
  </body>
When I click on the "reply" text, a new email opens with "subject-text" in the Subject field.  However, when I click on "dlreich@gmail.com", a new email opens with a blank Subject field. 

Where did the "<a class="moz-txt-link-abbreviated" href="mailto:dlreich@gmail.com">dlreich@gmail.com</a>" come from?

By the way, when I click Help-About Thunderbird, I'm told that Thunderbird is up to date and gives me the number 38.5.1, which I assume is the version number.
Yes, TB 38.5 is the latest official release.
I tried current development versions.

Jorg, are you able to reproduce this?
Flags: needinfo?(mozilla)
(In reply to dlreich from comment #2)
> When I click on the "reply" text, a new email opens with "subject-text" in
> the Subject field.  However, when I click on "dlreich@gmail.com", a new
> email opens with a blank Subject field.
Sure, since you clicked on:
<a class="moz-txt-link-abbreviated" href="mailto:dlreich@gmail.com">dlreich@gmail.com</a>

> Where did the "<a class="moz-txt-link-abbreviated"
> href="mailto:dlreich@gmail.com">dlreich@gmail.com</a>" come from?
Thunderbird searches the text for what looks like a link and inserts one where required. This is called "to linkify" - https://en.wiktionary.org/wiki/linkify.

> By the way, when I click Help-About Thunderbird, I'm told that Thunderbird
> is up to date and gives me the number 38.5.1, which I assume is the version
> number.
Yep.

Guys, I'd mark this bug "invalid". Sure, the linkify is a little overzealous to insert a link into the text of a link, but since this is in M-C, I don't really think we should fix anything here.
Yes, I can reproduce this in 38.4 (38.5 is not different). If you do what is described in comment #2 you get:

<body bgcolor="#FFFFFF" text="#000000">
    <a href="mailto:reich@gmail.com?subject=xx">reply</a> (<a
      href="mailto:reich@gmail.com?subject=xx"><a class="moz-txt-link-abbreviated" href="mailto:reich@reich.com">reich@reich.com</a></a>)<br>
</body>

(Sorry, bad address, but you get it.)
Flags: needinfo?(mozilla)
To be clear, I'm asserting that this is a bug because there is no way to add parameters such as "subject=" to a mailto: link under an email address while it is possible to do that for any other text in a message.  Perhaps a solution is to offer an option to turn off auto-linkify.
More like the autolinkification should be clever enough to not add a new <a> tag if there is already one present.
(In reply to :aceman from comment #7)
> More like the autolinkification should be clever enough to not add a new <a>
> tag if there is already one present.
Here's the code if you want to fix it ;-)
https://dxr.mozilla.org/comm-central/source/mozilla/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp#1217
Or refer it to the original author, BenB ;-)
Summary: TB removes ?subject=following-text from mailto: link manually placed on email address → Linkify sometimes overzealously inserts a hyperlink into the link text.
Component: Untriaged → Networking
Product: Thunderbird → Core
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [necko-would-take]
I'm forward duplicating this to bug 1274602. That bug describes different consequences of the same problem. However, the reporter helped us to identify that something changed between TB 31 and TB 38, so we have the chance to see whether we can understand the problem better through the regression range.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.