Skip to content

fix: adding fix for newline after < in german gmails#46

Open
ThriceGood wants to merge 1 commit intocrisp-oss:masterfrom
ThriceGood:fix/germain-gmail-newline-issue
Open

fix: adding fix for newline after < in german gmails#46
ThriceGood wants to merge 1 commit intocrisp-oss:masterfrom
ThriceGood:fix/germain-gmail-newline-issue

Conversation

@ThriceGood
Copy link
Copy Markdown

@ThriceGood ThriceGood commented Dec 2, 2025

There was already an addition for the English version of this problem. Where a newline is added after the < before the email in the 'from' line (I guess on long email addresses only?).

I also consolidated the two German Gmail regexes into one that handles the following formats:

Am DATE um TIME Uhr schrieb NAME <\nEMAIL>: (new line after first <)
Am DATE um TIME Uhr schrieb NAME :
Am DATE um TIME schrieb NAME:
Am DATE schrieb NAME :

I could not run the tests just to an import issue but ran a separate test for them with the following script:

// Am DATE um TIME Uhr schrieb NAME <EMAIL>:  (new line after first <)
//
const testDE1 = `
Blah blah blah.

Am Fr., 28. Nov. 2025 um 15:57 Uhr schrieb Test Mailer <
testing@testing.com>:

> Test
`

// Am DATE um TIME Uhr schrieb NAME <EMAIL>:
//
const testDE2 = `
Blah blah blah.

Am Fr., 28. Nov. 2025 um 15:57 Uhr schrieb Test Mailer <testing@testing.com>:

> Test
`

// Am DATE um TIME schrieb NAME:
//
const testDE3 = `
Blah blah blah.

Am Fr., 28. Nov. 2025 um 15:57 schrieb Test Mailer:

> Test
`

// Am DATE schrieb NAME <EMAIL>:
//
const testDE4 = `
Blah blah blah.

Am Fr., 28. Nov. 2025 schrieb Test Mailer <testing@testing.com>:

> Test
`


const emails = [testDE1, testDE2, testDE3, testDE4]

emails.forEach((e) => {
  console.log(new EmailReplyParser().parseReply(e).trim())
})

// output
//
// Blah blah blah.
// Blah blah blah.
// Blah blah blah.
// Blah blah blah.

Please run the original tests if you can.

@baptistejamin
Copy link
Copy Markdown
Contributor

Thank you for this.

I will merge, but once we have other PRs to be batched

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants