mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-24 17:10:07 +08:00
improve first name parser by adding honorific exclusions (#2732)
This commit is contained in:
parent
f7f5c2538f
commit
ddbf96a606
1 changed files with 2 additions and 2 deletions
|
@ -146,9 +146,9 @@ class Contact extends Model
|
|||
return @_nameParts().join(' ')
|
||||
|
||||
firstName: ->
|
||||
articles = ['a', 'the']
|
||||
exclusions = ['a', 'the', 'dr.', 'mrs.', 'mr.', 'mx.', 'prof.', 'ph.d.']
|
||||
for part in @_nameParts()
|
||||
if part.toLowerCase() not in articles
|
||||
if part.toLowerCase() not in exclusions
|
||||
return part
|
||||
return ""
|
||||
|
||||
|
|
Loading…
Reference in a new issue