https://phabricator.wikimedia.org/T116525 We were trying to figure out why the WYSIWYG/HTML editor for Wikipedia kept adding tel: links in places where we had number/year ranges (like for instance 788-7705), and this was pinpointed to iOS Safari, which supports format-detection https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html#//apple_ref/doc/uid/TP40008193-SW5. After disabling this feature with the meta tag in our main document, the problem still occurred. Further investigation made us discover that not only is format-detection applied to the current/primary document, it is applied to ALL documents including ones generated by DOMParser.parseFromString() which our WYSIWYG/HTML editor relies on. When as a developer you parse the DOM, do transformations etc, you should be able to somewhat accurately predict what DOM is being returned and these links being autogenerated are very unexpected honestly, they are not part of the document that was specified. I know we can adapt all documents we feed the parser, but I highly question these iOS features being applied to more than just the primary document and maybe iframes (and lets be honest they are annoying even there). There also is no way to IDENTIFY these auto generated links from normal links (adding an attribute to identify this as custom iOS generate node seems like an easy/quick win). Alternatively, DOMParser could inherit format-detection settings from the main document, or there could be some sort of flag to toggle this behavior in DOMParser without us having to rewrite the entire html blobstring .....
Created attachment 443941 [details] testcase
Added test case, showing the different behaviour on iOS (red) and macOS (green)
<rdar://problem/85433241>
I am able to reproduce this bug in iPhone 13 Pro Max using iOS 15.6 and it shows "Red" compared to "Green" on Safari 15.6 on macOS 12.5. Just wanted to share updated results. Thanks!