Skip to content

Commit cd4bb9e

Browse files
committed
- Fixed bug parsing self enclosing tags.
git-svn-id: svn://192.168.0.80/JavaXT/javaxt-core@666 2c7b0aa6-e0b2-3c4e-bb4a-8b65b6c465ff
1 parent 515f582 commit cd4bb9e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/javaxt/html/Element.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ protected Element(String html){
4545
tag = tag.replace("/>","");
4646
tag = tag.replace(">","");
4747
//tag = AddQuotes(tag);
48+
49+
tag = tag.replaceAll("\\s+"," ").trim();
4850
tag = tag.trim();
4951

5052
arr = tag.split(" ");

src/javaxt/html/Parser.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,17 @@ public Element getElementByAttributes(String tagName, String attributeName, Stri
268268

269269

270270
//Special case for tags that self terminate
271-
if (Tag.isEndTag()) return Element;
271+
if (Tag.isEndTag()){
272+
//Element.innerHTML = null;
273+
Element.outerHTML = tag.toString();
274+
return Element;
275+
}
272276

273277
}
274278
}
275279
}
276280
}
277-
else {
281+
else {
278282

279283
if (Tag.getName().equalsIgnoreCase(tagName)){
280284

0 commit comments

Comments
 (0)