changeset 48:9c66f1f840f7

Message content is now just set to HTML; the browser seems to be good at figuring out how to format non-compliant HTML on its own.
author Atul Varma <varmaa@toolness.com>
date Tue, 28 Apr 2009 17:57:35 +0000
parents 42b8c0229cd0
children 4e21d301ea27
files openwebchat.js
diffstat 1 files changed, 1 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/openwebchat.js	Tue Apr 28 17:41:34 2009 +0000
+++ b/openwebchat.js	Tue Apr 28 17:57:35 2009 +0000
@@ -65,14 +65,7 @@
       {onMessage: function onMessage(msg) {
          var block = $('#templates .message').clone();
 
-         // Try to dynamically determine if the message is HTML or not.
-         var parser = new DOMParser();
-         var dom = parser.parseFromString('<xml>' + msg.content + '</xml>',
-                                          'text/xml');
-         if (dom.firstChild.nodeName == 'parsererror')
-           $('.content', block).text(msg.content);
-         else
-           $('.content', block).html(msg.content);
+	 $('.content', block).html(msg.content);
 
          var author = msg.author ? msg.author : 'Anonymous';
          if (author != $('#content .author:last').text())