Selaa lähdekoodia

fixed nodeValue for comments, doctype, prolog.

Nicolas Cannasse 19 vuotta sitten
vanhempi
commit
24b5eaaf24
1 muutettua tiedostoa jossa 7 lisäystä ja 4 poistoa
  1. 7 4
      std/neko/NekoXml__.hx

+ 7 - 4
std/neko/NekoXml__.hx

@@ -83,18 +83,21 @@ class NekoXml__ {
 			comment : function(text) {
 				var x : Dynamic = new NekoXml__();
 				x._parentNode = untyped this.cur;
-				if( untyped __dollar__sget(text,1) == 63 )
+				if( untyped __dollar__sget(text,0) == 63 ) {
 					x.nodeType = Xml.Prolog;
-				else
+					text = "<"+new String(text)+">";
+				} else {
 					x.nodeType = Xml.Comment;
-				x._nodeValue = new String(text);
+					text = "<!--"+new String(text)+"-->";
+				}
+				x._nodeValue = text;
 				untyped this.cur.addChild(x);
 			},
 			doctype : function(text) {
 				var x : Dynamic = new NekoXml__();
 				x._parentNode = untyped this.cur;
 				x.nodeType = Xml.DocType;
-				x._nodeValue = new String(text);
+				x._nodeValue = "<!DOCTYPE"+new String(text)+">";
 				untyped this.cur.addChild(x);
 			},
 			done : function() {