@@ -48,15 +48,22 @@ public static String regexCompress(String str) {
48
48
String cssCodes = null ;
49
49
int idx1 = str .indexOf ("$WTC$$.registerCSS" );
50
50
int idx2 = -1 ;
51
- String specialFunKey = "@324@();\r \n " ;
52
- if (idx1 != -1 ) {
53
- idx2 = str .indexOf ("\" );\r \n " , idx1 );
54
- if (idx2 != -1 ) {
51
+ int idx = idx1 ;
52
+ while (idx != -1 ) {
53
+ int index = str .indexOf ("\" );\r \n " , idx );
54
+ if (index != -1 ) {
55
+ idx2 = index + 5 ;
55
56
ignoreCSS = true ;
56
- cssCodes = str .substring (idx1 , idx2 + 5 );
57
- str = str .substring (0 , idx1 ) + specialFunKey + str .substring (idx2 + 5 );
57
+ idx = str .indexOf ("$WTC$$.registerCSS" , idx2 );
58
+ } else {
59
+ break ;
58
60
}
59
61
}
62
+ String specialFunKey = "@324@();\r \n " ;
63
+ if (ignoreCSS ) {
64
+ cssCodes = str .substring (idx1 , idx2 );
65
+ str = str .substring (0 , idx1 ) + specialFunKey + str .substring (idx2 );
66
+ }
60
67
String regEx = "('[^\\ n\\ r]*[^\\ \\ ]')|" + // 1:1
61
68
"(\" ([^\\ n\\ r\\ \" ]|\\ \\ \\ \" )*[^\\ \\ ]\" )|" + // 1:3
62
69
"(\\ /\\ /[^\\ n\\ r]*[\\ n\\ r])|" + // 1:4
@@ -70,7 +77,7 @@ public static String regexCompress(String str) {
70
77
"(\\ s+)" ,
71
78
"$1$2$8$9" );
72
79
if (ignoreCSS ) {
73
- int idx = str .indexOf (specialFunKey );
80
+ idx = str .indexOf (specialFunKey );
74
81
if (idx != -1 ) {
75
82
str = str .substring (0 , idx ) + cssCodes + str .substring (idx + specialFunKey .length ());
76
83
} else {
@@ -85,14 +92,21 @@ public static String regexCompress2(String str) {
85
92
String cssCodes = null ;
86
93
int idx1 = str .indexOf ("$WTC$$.registerCSS" );
87
94
int idx2 = -1 ;
88
- String specialFunKey = "@324@();\r \n " ;
89
- if (idx1 != -1 ) {
90
- idx2 = str .indexOf ("\" );\r \n " , idx1 );
91
- if (idx2 != -1 ) {
95
+ int idx = idx1 ;
96
+ while (idx != -1 ) {
97
+ int index = str .indexOf ("\" );\r \n " , idx );
98
+ if (index != -1 ) {
99
+ idx2 = index + 5 ;
92
100
ignoreCSS = true ;
93
- cssCodes = str .substring (idx1 , idx2 + 5 );
94
- str = str .substring (0 , idx1 ) + specialFunKey + str .substring (idx2 + 5 );
101
+ idx = str .indexOf ("$WTC$$.registerCSS" , idx2 );
102
+ } else {
103
+ break ;
104
+ }
95
105
}
106
+ String specialFunKey = "@324@();\r \n " ;
107
+ if (ignoreCSS ) {
108
+ cssCodes = str .substring (idx1 , idx2 );
109
+ str = str .substring (0 , idx1 ) + specialFunKey + str .substring (idx2 );
96
110
}
97
111
String whiteSpace = "[ \\ f\\ t\\ v]" ;
98
112
String regEx = "('[^\\ n\\ r]*[^\\ \\ ]')|" + // 1:1
@@ -108,7 +122,7 @@ public static String regexCompress2(String str) {
108
122
"(" + whiteSpace + "+)" ,
109
123
"$1$2$8$9" );
110
124
if (ignoreCSS ) {
111
- int idx = str .indexOf (specialFunKey );
125
+ idx = str .indexOf (specialFunKey );
112
126
if (idx != -1 ) {
113
127
str = str .substring (0 , idx ) + cssCodes + str .substring (idx + specialFunKey .length ());
114
128
} else {
0 commit comments