kamnani commented on a change in pull request #351:
URL: https://github.com/apache/tomcat/pull/351#discussion_r483088141



##########
File path: java/org/apache/jasper/compiler/Generator.java
##########
@@ -2095,6 +2104,20 @@ public void visit(Node.JspElement n) throws 
JasperException {
         public void visit(Node.TemplateText n) throws JasperException {
 
             String text = n.getText();
+            // If the flag is active, attempt to minimize the frequency of
+            // regex operations.
+            if ((ctxt!=null) &&
+                ctxt.getOptions().getJSPWhiteSpaceTrimFlag() &&
+                text.contains("\n")) {
+                // Ensure there are no <pre> or </pre> tags embedded in this
+                // text - if there are, we want to NOT modify the whitespace.
+                Matcher preMatcher = PRE_TAG_PATTERN.matcher(text);

Review comment:
       So this just allows us to leave the pre tags untouched. It should catch 
any node that might have <pre> |  </pre> |  both as the comment explains. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to