(js) Improve extraction of HTML signature

This commit is contained in:
Francis Lachapelle
2016-07-27 14:01:22 -04:00
parent d95b90281b
commit 199c9d9237
2 changed files with 8 additions and 2 deletions

View File

@@ -1,3 +1,5 @@
/* -*- Mode: javascript; indent-tabs-mode: nil; js-indent-level: 4; -*- */
var filters = [];
var mailAccounts = null;
var dialogs = {};
@@ -887,8 +889,11 @@ function displayAccountSignature(mailAccount) {
? mailAccount["identities"][0]
: {} );
var value = identity["signature"];
if (value && value.length > 0)
value = value.stripTags().unescapeHTML().replace(/^[ \n\r]*/, "");
var element;
if (value && value.length > 0) {
element = new Element('div').update(value);
value = element.allTextContent().unescapeHTML().replace(/^[ \n\r]*/, "");
}
if (value && value.length > 0) {
if (value.length < 30) {
actSignatureValue = value;