Remove eval
from css-lint
Evaluate string token with `RegExp.exec()` instead of `eval()`.
This commit is contained in:
parent
83bcde6569
commit
ae327d4ee1
|
@ -4341,9 +4341,12 @@ function PropertyValuePart(text, line, col){
|
|||
this.type = "function";
|
||||
this.name = RegExp.$1;
|
||||
this.value = text;
|
||||
} else if (/^["'][^"']*["']/.test(text)){ //string
|
||||
// } else if (/^["'][^"']*["']/.test(text)){ //string
|
||||
// this.type = "string";
|
||||
// this.value = eval(text);
|
||||
} else if (/^(["'])[^\1]*\1/.test(text)){ //string
|
||||
this.type = "string";
|
||||
this.value = eval(text);
|
||||
this.value = /^(["'])([^\1]*)\1/.exec(text)[2];
|
||||
} else if (Colors[text.toLowerCase()]){ //named color
|
||||
this.type = "color";
|
||||
temp = Colors[text.toLowerCase()].substring(1);
|
||||
|
|
2
edit.js
2
edit.js
|
@ -329,7 +329,7 @@ window.addEventListener("load", init, false);
|
|||
|
||||
function init() {
|
||||
tE("sections-help", "helpAlt", "alt");
|
||||
loadPrefs({"smart-indent": "true"});
|
||||
loadPrefs({"smart-indent": true});
|
||||
var params = getParams();
|
||||
if (!params.id) { // match should be 2 - one for the whole thing, one for the parentheses
|
||||
// This is an add
|
||||
|
|
Loading…
Reference in New Issue
Block a user