Preserve line breaks into XHTML
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Mon, 16 Aug 2010 11:09:49 +0000 (11:09 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Mon, 16 Aug 2010 11:09:49 +0000 (11:09 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@1534 59b500cc-1b3d-0410-9834-0bbf25fbcc57

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", "&lt;br/&gt;");
         }
 
         byte[] rawBytes = result.getRawBytes();
@@ -82,6 +83,7 @@
           displayResult = "(Not applicable)";
         } else {
           displayResult = StringEscapeUtils.escapeXml(displayResult);
+          displayResult = displayResult.replaceAll("\r?\n", "&lt;br/&gt;");
         }
     </jsp:scriptlet>
     <table>