Preserve line breaks into XHTML
[zxing.git] / zxingorg / web / decoderesult.jspx
index 658cca1..b7002f3 100644 (file)
@@ -67,6 +67,7 @@
           text = "(Not applicable)";
         } else {
           text = StringEscapeUtils.escapeXml(text);
+          text = text.replaceAll("\r?\n", "<br/>");
         }
 
         byte[] rawBytes = result.getRawBytes();
@@ -82,6 +83,7 @@
           displayResult = "(Not applicable)";
         } else {
           displayResult = StringEscapeUtils.escapeXml(displayResult);
+          displayResult = displayResult.replaceAll("\r?\n", "<br/>");
         }
     </jsp:scriptlet>
     <table>