diff options
Diffstat (limited to 'src/util.js')
-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 dfcf613..bc8ec40 100644 --- a/src/util.js +++ b/src/util.js @@ -110,7 +110,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 |