[LON-CAPA-cvs] cvs: loncom /html/htmlarea htmlarea.js

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 17 Feb 2005 08:59:45 -0000


albertel		Thu Feb 17 03:59:45 2005 EDT

  Modified files:              
    /loncom/html/htmlarea	htmlarea.js 
  Log:
  - simpler fix for the stupid non-breaking space versus encoding bug
  
  
Index: loncom/html/htmlarea/htmlarea.js
diff -u loncom/html/htmlarea/htmlarea.js:1.4 loncom/html/htmlarea/htmlarea.js:1.5
--- loncom/html/htmlarea/htmlarea.js:1.4	Tue Jun  1 20:55:16 2004
+++ loncom/html/htmlarea/htmlarea.js	Thu Feb 17 03:59:45 2005
@@ -9,7 +9,7 @@
 // Version 3.0 developed by Mihai Bazon.
 //   http://dynarch.com/mishoo
 //
-// $Id: htmlarea.js,v 1.4 2004/06/02 00:55:16 www Exp $
+// $Id: htmlarea.js,v 1.5 2005/02/17 08:59:45 albertel Exp $
 
 if (typeof _editor_url == "string") {
 	// Leave exactly one backslash at the end of _editor_url
@@ -2038,7 +2038,8 @@
 	    case 3: // Node.TEXT_NODE
 		// If a text node is alone in an element and all spaces, replace it with an non breaking one
 		// This partially undoes the damage done by moz, which translates ' 's into spaces in the data element
-		if ( !root.previousSibling && !root.nextSibling && root.data.match(/^\s*$/i) ) html = ' ';
+		// this was   but since are document encodings are all over the place it causes random havoc
+		if ( !root.previousSibling && !root.nextSibling && root.data.match(/^\s*$/i) ) html = ' ';
 		else html = HTMLArea.htmlEncode(root.data);
 		break;
 	    case 8: // Node.COMMENT_NODE