Skip to content

Commit 816114f

Browse files
authored
fix(message-threading): Take non-standard but conventional subject prefixes into account (#605)
1 parent 85e09ec commit 816114f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/message-handler.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1456,12 +1456,13 @@ class MessageHandler {
14561456
options = options || {};
14571457
subject = subject.replace(/\s+/g, ' ').trim();
14581458

1459+
// `Re: [EXTERNAL] Re: Fwd: Example subject (fwd)` becomes `Example subject`
14591460
if (options.removePrefix) {
14601461
let match = true;
14611462
while (match) {
14621463
match = false;
14631464
subject = subject
1464-
.replace(/^(re|fwd?)\s*:|\s*\(fwd\)\s*$/gi, () => {
1465+
.replace(/^(re|fwd?)\s*:|^\[.+?\](?=\s.+)|\s*\(fwd\)\s*$/gi, () => {
14651466
match = true;
14661467
return '';
14671468
})

0 commit comments

Comments
 (0)