github / github/email_reply_parser

Signature regular expression

未关闭
#53 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Ruby
星标
708
派生
156
PR 合并指标
30 天内没有已合并 PR

描述

I ran into some random situations where emails were not parsed correctly. Part of the email was chopped out, for example:
`Hi Test,\n\n-This is a test`
Will result in `-This is a test` fragment being hidden and considered as part of signature which it should not be. After digging more into the problem, we figured out that:
`(?m)(--\s*$|__\s*$|\w-$)|(^(\w+\s*){1,3} ym morf tneS$)`
The first matching group is testing against `\w-`, which is causing the problem. I can't think out of a better way to solve the problem other than take `\w-$` part out so it opens to any suggestion.

贡献指南

打开贡献指南

调研方向

Start with the signature regular expression shown in the issue and reproduce the provided email example to inspect why the fragment is classified as a signature. Confirm the matching behavior after deciding how the \w-$ alternative should be handled, and verify that the sample fragment remains visible.

由索引模型根据 Issue 内容生成。

评估

技术栈
ruby
领域
backend
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。