From 900f720a7a0893f37f8c6b328f183e43086c1e52 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sun, 3 Sep 2023 18:01:05 +0100 Subject: email: Tolerate parentheses in display names. * email/email.scm (define-atom-pattern): Support customization of the atext pattern as well. (define-phrase-pattern): New macro. (obs-phrase): Define using define-phrase-pattern. (liberal-atext, liberal-cfws-captured-atom, liberal-cfws-captured-word, liberal-phrase): New patterns. (display-name): Use liberal-phrase instead of phrase. * tests/email.scm ("tolerate email addresses with parentheses in name"): New test. --- tests/email.scm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/email.scm b/tests/email.scm index 50d1bea..dd305b6 100644 --- a/tests/email.scm +++ b/tests/email.scm @@ -590,6 +590,10 @@ Content-Type: text/plain; charset=utf-8 (parse-email-address "Foo P. Bar ") '((name . "Foo P. Bar") (address . "foo@example.com"))) +(test-equal "tolerate email addresses with parentheses in name" + (parse-email-address "Foo(Bar ") + '((name . "Foo(Bar") (address . "foo@example.com"))) + ;;; ;;; MIME encoded words -- cgit v1.2.3