From e973df97e297e67a9e92c6cc35d5953bdee15f14 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Mon, 2 Jun 2025 11:43:07 +0200 Subject: [PATCH] Use more complete regexp https://github.com/basecamp/fizzy/pull/564/files#r2119855866 --- app/helpers/html_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/html_helper.rb b/app/helpers/html_helper.rb index b989adf12..f61da26c1 100644 --- a/app/helpers/html_helper.rb +++ b/app/helpers/html_helper.rb @@ -9,7 +9,7 @@ module HtmlHelper private EXCLUDED_ELEMENTS = %w[ a figcaption pre code ] - EMAIL_REGEXP = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/ + EMAIL_REGEXP = /\b[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\b/ URL_REGEXP = URI::DEFAULT_PARSER.make_regexp(%w[http https]) def auto_link(fragment)