Skip to content

Conversation

@kairosci
Copy link

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
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
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!

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

3 participants