Skip to content

fix: Fix mailto links truncated at dash#20565

Merged
timvandermeij merged 1 commit intomozilla:masterfrom
kairosci:fix-bug-20557
Feb 1, 2026
Merged

fix: Fix mailto links truncated at dash#20565
timvandermeij merged 1 commit intomozilla:masterfrom
kairosci:fix-bug-20557

Conversation

@kairosci
Copy link
Contributor

This PR fixes a bug where mailto: links containing hyphens in the domain part were truncated (e.g., user@uni-city.tld -> user@uni).

The Fix

Modified the regex in web/autolinker.js to explicitly allow hyphens (-) in the domain part of email addresses, while maintaining the exclusion of other punctuation.

Verification

Fixes #20557.

@kairosci kairosci changed the title Fix bug #20557: Mailto links truncated at dash fix: Fix mailto links truncated at dash Jan 10, 2026
@nicolo-ribaudo
Copy link
Contributor

I also noticed a PDF with a mislinked address with a dash before the @ (dg.ssa-div4@pec.mit.gov.it) a couple days ago

@kairosci
Copy link
Contributor Author

@timvandermeij @calixteman PTAL, thanks!

Modified the regex in web/autolinker.js to explicitly allow hyphens (-) in
the domain part of email addresses, while maintaining the exclusion of
other punctuation. This fixes mailto links like user@uni-city.tld being
truncated at the hyphen.

Fixes mozilla#20557
@kairosci
Copy link
Contributor Author

Updated and formatted the linker file, updated the branch and added a single commit that describes the changes made (with multi-line description), I think that's all!

@calixteman
Copy link
Contributor

/botio unittest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_unittest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/ad97d3b198fc4b7/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_unittest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/d5aadbee99d1733/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/d5aadbee99d1733/output.txt

Total script time: 2.59 mins

  • Unit Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/ad97d3b198fc4b7/output.txt

Total script time: 15.04 mins

  • Unit Tests: FAILED

@timvandermeij timvandermeij merged commit 384c620 into mozilla:master Feb 1, 2026
8 checks passed
@timvandermeij
Copy link
Contributor

Thank you for improving this!

@kairosci kairosci deleted the fix-bug-20557 branch February 1, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Some mailto links with dash inside are not shown correctly

5 participants