File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
org/w3c/css/properties/css2/font Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -143,13 +143,23 @@ public String toString() {
143
143
}
144
144
145
145
String convertString (String value ) {
146
- if (value .indexOf ('"' ) != -1 ) {
147
- return '\'' + value + '\'' ;
148
- } else if (value .indexOf ('\'' ) != -1 ) {
149
- return '"' + value + '"' ;
150
- } else {
151
- return value ;
152
- }
146
+ char cfirst = value .charAt (0 );
147
+ char clast = value .charAt (value .length ()-1 );
148
+
149
+ if (cfirst == clast
150
+ && (cfirst == '\'' || cfirst =='"' )
151
+ ){
152
+ // is already well escaped
153
+ return value ;
154
+ }
155
+
156
+ if (value .indexOf ('"' ) != -1 ) {
157
+ return '\'' + value + '\'' ;
158
+ } else if (value .indexOf ('\'' ) != -1 ) {
159
+ return '"' + value + '"' ;
160
+ } else {
161
+ return value ;
162
+ }
153
163
}
154
164
155
165
/**
You can’t perform that action at this time.
0 commit comments