tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andy...@apache.org
Subject svn commit: r547439 - in /tapestry/tapestry4/trunk/tapestry-framework/src/js: tapestry/core.js tests/test_html.js
Date Thu, 14 Jun 2007 23:06:40 GMT
Author: andyhot
Date: Thu Jun 14 16:06:39 2007
New Revision: 547439

URL: http://svn.apache.org/viewvc?view=rev&rev=547439
Log:
refine regexp

Modified:
    tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js
    tapestry/tapestry4/trunk/tapestry-framework/src/js/tests/test_html.js

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js?view=diff&rev=547439&r1=547438&r2=547439
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js Thu Jun 14 16:06:39
2007
@@ -446,8 +446,8 @@
  */
 tapestry.html={
 
-    TextareaRegexp:new RegExp('<([a-zA-Z]?)\\s(.*?)/>'), // regexp for compact textarea
elements
-    TextareaReplacer:'<$1 $2></$1>', // replace pattern for compact textareas
+    CompactElementRegexp:new RegExp('<([a-zA-Z]*)(.*?)/>'), // regexp for compact html
elements
+    CompactElementReplacer:'<$1$2></$1>', // replace pattern for compact html
elements
 	
     /**
 	 * Function: getContentAsString
@@ -531,7 +531,7 @@
 		        return this._getContentAsStringGeneric(node);
         }
 
-        return this._processTextareas(s);
+        return this._processCompactElements(s);
 	},
 	
 	_getContentAsStringGeneric:function(node){
@@ -555,10 +555,10 @@
 		return s;	
 	},
 
-	_processTextareas:function(htmlData)
+	_processCompactElements:function(htmlData)
  	{
-        while (htmlData.match(this.TextareaRegexp)){
-            htmlData = htmlData.replace(this.TextareaRegexp, this.TextareaReplacer);
+            while (htmlData.match(this.CompactElementRegexp)){                
+                htmlData = htmlData.replace(this.CompactElementRegexp, this.CompactElementReplacer);
         }
         return htmlData;
  	}

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tests/test_html.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tests/test_html.js?view=diff&rev=547439&r1=547438&r2=547439
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tests/test_html.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tests/test_html.js Thu Jun 14 16:06:39
2007
@@ -35,9 +35,9 @@
     var initial = "start<textarea id='2' rows=4/>";
     var expected = "start<textarea id='2' rows=4></textarea>";
     
-    jum.assertEquals(expected, tapestry.html._processTextareas(initial));
+    jum.assertEquals(expected, tapestry.html._processCompactElements(initial));
     jum.assertEquals(expected + expected, 
-        tapestry.html._processTextareas(initial+initial));
+        tapestry.html._processCompactElements(initial+initial));
 }
 
 function _createTestNode(element, empty){



Mime
View raw message