commit | 897fef439ac6bc4a0b78a30d990137335ccf712d | [log] [tgz] |
---|---|---|
author | Werner Punz <werpu@apache.org> | Tue Oct 30 16:09:06 2012 +0000 |
committer | Werner Punz <werpu@apache.org> | Tue Oct 30 16:09:06 2012 +0000 |
tree | 5a307c12460b51a8bcbb7a9921d054aef9071e6f | |
parent | 4c2aeef5f426ded3e0d83c8452c33ae6ff095fd2 [diff] |
https://issues.apache.org/jira/browse/EXTSCRIPT-179 fixing the code block handling for the compiler git-svn-id: https://svn.apache.org/repos/asf/myfaces/extensions/scripting/trunk@1403759 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/extscript-doccompiler/src/main/java/org/apache/myfaces/extension/scripting/doccompiler/XSLTDocCompiler.java b/extscript-doccompiler/src/main/java/org/apache/myfaces/extension/scripting/doccompiler/XSLTDocCompiler.java index 97a6e56..bbf1d6f 100644 --- a/extscript-doccompiler/src/main/java/org/apache/myfaces/extension/scripting/doccompiler/XSLTDocCompiler.java +++ b/extscript-doccompiler/src/main/java/org/apache/myfaces/extension/scripting/doccompiler/XSLTDocCompiler.java
@@ -86,7 +86,6 @@ pos++; while (!lines[pos].contains("</code>")) { - //code blocks must be at least 4 chars into the current line target.append(" "); target.append(lines[pos]); target.append("\n"); @@ -110,12 +109,16 @@ } else if (line.matches("\\s+[^#]+")) { line = line.replaceAll("\\s+", " "); + } else if (line.matches("\\s+#.+")) { line = line.replaceAll("\\s+", ""); } - target.append(line); - target.append("\n"); + if (!line.contains("<code>")) + { + target.append(line); + target.append("\n"); + } } return target.toString(); }