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
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 2 additions and 2 deletions

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%";
}