From 624509417ce495d9318a010562b6bae8f4f31658 Mon Sep 17 00:00:00 2001 From: Alan Tay Date: Fri, 23 Jun 2017 00:21:42 +0800 Subject: [PATCH] run trim() on html before assigning to textDefault --- jQuery.succinct.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jQuery.succinct.js b/jQuery.succinct.js index 63399eb..ee535c1 100644 --- a/jQuery.succinct.js +++ b/jQuery.succinct.js @@ -27,7 +27,7 @@ regex = /[!-\/:-@\[-`{-~]$/, init = function() { elements.each(function() { - textDefault = $(this).html(); + textDefault = $(this).html().trim(); if (textDefault.length > settings.size) { textTruncated = $.trim(textDefault)