Skip to content

AO3-7517 Disable phone number detection in emails on iOS#5925

Open
not-varram wants to merge 2 commits into
otwcode:masterfrom
not-varram:AO3-7517
Open

AO3-7517 Disable phone number detection in emails on iOS#5925
not-varram wants to merge 2 commits into
otwcode:masterfrom
not-varram:AO3-7517

Conversation

@not-varram

Copy link
Copy Markdown
Contributor

Pull Request Checklist

Issue

https://otwarchive.atlassian.net/browse/AO3-7517 (Please fill in issue number and remove this comment.)

Purpose

What does this PR do?

Prevent IOS from considering numerical strings of certain lengths as phone numbers via adding a certain meta tag to the email.

Credit

varram (he/him)

@pmonfort
pmonfort self-requested a review July 19, 2026 03:32

@pmonfort pmonfort left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! The update looks good, I left a couple of small comments

@@ -1,5 +1,6 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="format-detection" content="telephone=no" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also update the existing meta tag on line 2 to use a self-closing /> ? I know is not related to your change but is a good opportunity to update it to match the rest of the project's layouts

Comment on lines +7 to +11
it "disables phone number detection in the HTML version" do
html = Nokogiri::HTML(email.html_part.decoded)

expect(html.at_xpath("//meta[@name='format-detection'][@content='telephone=no']")).to be_present
end

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The project uses have_xpath in mailer specs for checking HTML structure. Could you use that instead of parsing with Nokogiri directly? Something like:

Suggested change
it "disables phone number detection in the HTML version" do
html = Nokogiri::HTML(email.html_part.decoded)
expect(html.at_xpath("//meta[@name='format-detection'][@content='telephone=no']")).to be_present
end
it "disables phone number detection in the HTML version" do
expect(email.html_part).to have_xpath("//meta[@name='format-detection'][@content='telephone=no']")
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants