diff options
-rw-r--r-- | src/util.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util.js b/src/util.js index ed4d1c4..f85c705 100644 --- a/src/util.js +++ b/src/util.js @@ -104,7 +104,11 @@ Candy.Util = (function(self, $){ * (Integer) len - Max text length */ self.parseAndCropXhtml = function(str, len) { - return $('<div/>').append(self.createHtml($(str).get(0), len)).html(); + var msg = str; + if ( typeof str !== 'string' ) { + msg = self.createHtml($(str).get(0), len); + } + return $("<div/>").append(msg).html(); }; /** Function: setCookie |