UIDataDetectorTypeLink does not include leading "#" character in email address when creating mailto URL

Originator:lee.laborczfalvi
Number:rdar://27986180 Date Originated:24/08/16
Status:Open Resolved:
Product:iOS Product Version:iOS9+
Classification: Reproducible:YES
 
Area:
UIKit

Summary:
In our app we show web content in a UIWebView. Part of our app allows the user to tap on an email address that's shown inside the UIWebView and have that create a new message with that email address as the recipient.

To implement this we make use of the UIDataDetectorTypeLink data detector in the UIWebView. Unfortunately if we have an email address that looks like this:

#distribution-list@company.com

The leading "#" is dropped from the email address that is resolved by the data detector. As a result, tapping on the email address creates a message to the wrong address. The email has distribution-list@company.com as the address instead of #distribution-list@company.com

I've attached a screenshot showing the DOM as shown in safari web debugger. Note that the leading "#" is ignored and dropped.

Steps to Reproduce:
Have a UIWebView that shows a HTML document that contains the following user facing text

#distribution-list@company.com

Enable UIDataDetectorTypeLink data detection on the UIWebView 

Note that the email address is linkified but the leading "#" is not.

Expected Results:
The entire email address including the "#" should be linkified.

Actual Results:
The "#" is not linkified, and tapping on the link results in an email address that does not include the leading "#"

Version:
iOS9+

Notes:


Configuration:
iPhone / iPad - any

Attachments:
'DOM inspector of sample email.png' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!