.replaceFirst("^[{\\(]+(|.*[^}\\)])[}\\)]+$", "$1") // Remove ({})\r
.replaceAll("\\('([^\\)]+)'\\)" , "($1)") // Remove quotes\r
.replaceAll(",+([\\w-]+:+)" , ";$1") // put semicolon\r
- .replaceAll(":\\s*[\"']?([^;]+)([;]+|$)[\"']?\\s*", ":'$1',") // put quotes\r
+ .replaceAll(":\\s*[\"']?([^';]*)[\"']?\\s*(;+|$)", ":'$1',") // put quotes\r
.replaceAll(":'(-?[\\d\\.]+|null|false|true)',", ":$1,") // numbers do not need quote\r
.replaceFirst("[;,]$", "") // remove endings \r
- .replaceAll("\\s*[']+\\s*", "'") // remove duplicates\r
+ "})";\r
return ret;\r
}\r
.wrapPropertiesString("b: 'a'; c: 1, /*gg: aadf*/d: url('https://test.com');,e:null,f:false"));
assertEquals("({color:'rgb(0,0,139)',background:'red'})", Properties
.wrapPropertiesString("color: 'rgb(0, 0,139)', background: red"));
+ assertEquals("({width:'',top:''})", Properties
+ .wrapPropertiesString("width: '' ; top:'' ;"));
}
}