diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-01-22 17:47:32 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-01-22 17:47:32 +0100 |
| commit | fa1f2132e79f2ac2314a8b417d5d35d6571bd41b (patch) | |
| tree | 3789a8335dd5089998de3c5c6a391b2d95a85187 /addons/mail/static/src/js/utils.js | |
| parent | db27489fe756b24647e993a22340705625839698 (diff) | |
| parent | 950d9b2369046f2e3199d144df8edbd0e63f8a2f (diff) | |
[MERGE] forward port branch 11.0 up to 950d9b23690
Diffstat (limited to 'addons/mail/static/src/js/utils.js')
| -rw-r--r-- | addons/mail/static/src/js/utils.js | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/addons/mail/static/src/js/utils.js b/addons/mail/static/src/js/utils.js index 6364be77eb5..49d1705eccd 100644 --- a/addons/mail/static/src/js/utils.js +++ b/addons/mail/static/src/js/utils.js @@ -100,15 +100,17 @@ function inline (node, transform_children) { // Parses text to find email: Tagada <address@mail.fr> -> [Tagada, address@mail.fr] or False function parse_email (text) { - var result = text.match(/(.*)<(.*@.*)>/); - if (result) { - return [_.str.trim(result[1]), _.str.trim(result[2])]; - } - result = text.match(/(.*@.*)/); - if (result) { - return [_.str.trim(result[1]), _.str.trim(result[1])]; + if (text){ + var result = text.match(/(.*)<(.*@.*)>/); + if (result) { + return [_.str.trim(result[1]), _.str.trim(result[2])]; + } + result = text.match(/(.*@.*)/); + if (result) { + return [_.str.trim(result[1]), _.str.trim(result[1])]; + } + return [text, false]; } - return [text, false]; } // Replaces textarea text into html text (add <p>, <a>) |
