[freenet-cvs] r15676 - trunk/freenet/src/freenet/support

bombe at freenetproject.org bombe at freenetproject.org
Sat Nov 3 20:08:15 UTC 2007


Author: bombe
Date: 2007-11-03 20:08:15 +0000 (Sat, 03 Nov 2007)
New Revision: 15676

Modified:
   trunk/freenet/src/freenet/support/
   trunk/freenet/src/freenet/support/HTMLNode.java
Log:
 r12814 at natrium:  bombe | 2007-11-01 13:39:34 +0100
 let a # tag with null content be a container for several adjacent childs



Property changes on: trunk/freenet/src/freenet/support
___________________________________________________________________
Name: svk:merge
   - 6a5e1407-ac3d-0410-81af-9028a69beae8:/branch/freenet-documentation-browser/src/freenet/support:12813
   + 6a5e1407-ac3d-0410-81af-9028a69beae8:/branch/freenet-documentation-browser/src/freenet/support:12814

Modified: trunk/freenet/src/freenet/support/HTMLNode.java
===================================================================
--- trunk/freenet/src/freenet/support/HTMLNode.java	2007-11-03 20:07:41 UTC (rev 15675)
+++ trunk/freenet/src/freenet/support/HTMLNode.java	2007-11-03 20:08:15 UTC (rev 15676)
@@ -136,7 +136,7 @@
 	}
 
 	public StringBuffer generate(StringBuffer tagBuffer) {
-		if (name.equals("#")) {
+		if (name.equals("#") && (content != null)) {
 			HTMLEncoder.encodeToBuffer(content, tagBuffer);
 			return tagBuffer;
 		}
@@ -146,6 +146,13 @@
 			tagBuffer.append(content);
 			return tagBuffer;
 		}
+		if (name.equals("#")) {
+			for (int childIndex = 0, childCount = children.size(); childIndex < childCount; childIndex++) {
+				HTMLNode childNode = (HTMLNode) children.get(childIndex);
+				childNode.generate(tagBuffer);
+			}
+			return tagBuffer;
+		}
 		tagBuffer.append('<').append(name);
 		Set attributeSet = attributes.entrySet();
 		for (Iterator attributeIterator = attributeSet.iterator(); attributeIterator.hasNext();) {




More information about the cvs mailing list