You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2022/07/28 21:59:47 UTC
[royale-compiler] 01/02: formatter: fix detection of opening mx|fx:Script element when document contains CRLF newlines
This is an automated email from the ASF dual-hosted git repository.
joshtynjala pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
commit d76804aae02115dbb76c09eb3b39ab183281da5f
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Thu Jul 28 13:17:29 2022 -0700
formatter: fix detection of opening mx|fx:Script element when document contains CRLF newlines
---
formatter/src/main/java/org/apache/royale/formatter/FORMATTER.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/formatter/src/main/java/org/apache/royale/formatter/FORMATTER.java b/formatter/src/main/java/org/apache/royale/formatter/FORMATTER.java
index a512c0987..f73dc03bb 100644
--- a/formatter/src/main/java/org/apache/royale/formatter/FORMATTER.java
+++ b/formatter/src/main/java/org/apache/royale/formatter/FORMATTER.java
@@ -408,7 +408,7 @@ public class FORMATTER {
}
StringBuilder builder = new StringBuilder();
Pattern scriptPattern = Pattern.compile(
- "^<((?:mx|fx):(\\w+))>\\s*(<!\\[CDATA\\[)?((?:.|\\n)*?)(?:\\]\\]>)?\\s*<\\/(?:mx|fx):(?:\\w+)>$");
+ "^<((?:mx|fx):(\\w+))>\\s*(<!\\[CDATA\\[)?((?:.|(?:\\r?\\n))*?)(?:\\]\\]>)?\\s*<\\/(?:mx|fx):(?:\\w+)>$");
Matcher scriptMatcher = scriptPattern.matcher(text);
if (!scriptMatcher.matches()) {
return text;