From a41e610e6cef019ce298b3a6cb437ece044c6ff8 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 17 Jul 2019 21:32:51 -0400 Subject: [PATCH] Fix display of original string length in debug output for ellipsize() --- chrome/content/zotero/xpcom/utilities.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js index c242e32839..ce5d85e37c 100644 --- a/chrome/content/zotero/xpcom/utilities.js +++ b/chrome/content/zotero/xpcom/utilities.js @@ -883,6 +883,7 @@ Zotero.Utilities = { if (str.length <= len) { return str; } + var origLen = str.length; let radius = Math.min(len, 5); if (wordBoundary) { let min = len - radius; @@ -896,7 +897,7 @@ Zotero.Utilities = { else { str = str.substr(0, len) } - return str + '\u2026' + (countChars ? ' (' + str.length + ' chars)' : ''); + return str + '\u2026' + (countChars ? ' (' + origLen + ' chars)' : ''); },