From aa653925abf1b432b1cf0daf7710da0a3ddc5c84 Mon Sep 17 00:00:00 2001 From: Nefaro Date: Mon, 22 Feb 2016 11:15:44 +0200 Subject: [PATCH] Proposed change for issue #71 (+1 squashed commits) Squashed commits: [158e162] Proposed change for issue #71 Boundary check for fixed with truncation; skip truncation if text length is smaller than the requested truncation size. --- trunk8.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/trunk8.js b/trunk8.js index 1e58fbc..23933b5 100644 --- a/trunk8.js +++ b/trunk8.js @@ -208,7 +208,11 @@ } else if (!isNaN(width)) { bite_size = length - width; - + + if (bite_size < 0) { + return; + } + bite = utils.eatStr(str, side, bite_size, fill); this.html(bite);