Better regex for parsing config select width placeholder style

This commit is contained in:
Nick O'Leary
2021-09-29 19:12:13 +01:00
parent 9ccffee82c
commit 0cbf4ac37d

View File

@@ -250,8 +250,8 @@ RED.editor = (function() {
var newWidth = input.width();
var attrStyle = input.attr('style');
var m;
if ((m = /width\s*:\s*([^;]+)/i.exec(attrStyle)) !== null) {
newWidth = m[1].trim();
if ((m = /(^|\s|;)width\s*:\s*([^;]+)/i.exec(attrStyle)) !== null) {
newWidth = m[2].trim();
} else {
newWidth = "70%";
}