Skip to content

Commit e2a5901

Browse files
committed
Preserved NBSP characters on indent
1 parent 8ea08fd commit e2a5901

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

lib/xmljava.jar

14 Bytes
Binary file not shown.

src/com/maxprograms/xml/Constants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
public class Constants {
1616

17-
public static final String VERSION = "2.1.0";
18-
public static final String BUILD = "20250122_0906";
17+
public static final String VERSION = "2.1.1";
18+
public static final String BUILD = "20250217_1831";
1919

2020
private Constants() {
2121
// private for security

src/com/maxprograms/xml/Indenter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ private static boolean hasText(Element e) {
8888
if (text != null) {
8989
for (int i = 0; i < text.length(); i++) {
9090
char c = text.charAt(i);
91-
if (!(Character.isSpaceChar(c) || c == '\n' || c =='\r' || c == '\t')) {
91+
if (c == '\u00A0') {
92+
return true;
93+
}
94+
if (!(Character.isSpaceChar(c) || c == '\n' || c == '\r' || c == '\t' || c == '\u00A0')) {
9295
return true;
9396
}
9497
}
@@ -97,5 +100,4 @@ private static boolean hasText(Element e) {
97100
}
98101
return false;
99102
}
100-
101103
}

0 commit comments

Comments
 (0)