XML formatter fix: line breaks at the end of the text will be eaten – if you need them, use indentText = false v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 04 Jan 2014 21:20:48 +0100
branchv_0
changeset 132f785ee7a70a2
parent 131 347a7dd94a3f
child 133 a1bf1465df89
XML formatter fix: line breaks at the end of the text will be eaten – if you need them, use indentText = false
java/sql-dk/src/info/globalcode/sql/dk/formatting/AbstractXmlFormatter.java
     1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/AbstractXmlFormatter.java	Sat Jan 04 20:24:27 2014 +0100
     1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/AbstractXmlFormatter.java	Sat Jan 04 21:20:48 2014 +0100
     1.3 @@ -142,7 +142,11 @@
     1.4  			/*
     1.5  			 * line breaks at the end of the text will be eaten – if you need them, use indentText = false
     1.6  			 */
     1.7 -			printText(lines[0], false);
     1.8 +			if (lines.length == 1 && text.endsWith("\n")) {
     1.9 +				text = text.substring(0, text.length() - 1);
    1.10 +			}
    1.11 +
    1.12 +			printText(text, false);
    1.13  			printEndElement(false);
    1.14  		}
    1.15  	}