Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/candy-chat/candy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/util.js6
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