From d910b763b2434672f7b74bbc6bed52ce67eeaa0d Mon Sep 17 00:00:00 2001 From: bojiang Date: Mon, 12 Dec 2022 16:47:06 +0800 Subject: [PATCH] fixed d3a7c24 from https://gitee.com/BoJiang4702/third_party_weex-loader/pulls/133 jiangbo91@huawei.com Signed-off-by: bojiang Change-Id: I1d866c2c6427b90a3c66e192518ded161924b6b8 --- deps/weex-styler/lib/validator.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/deps/weex-styler/lib/validator.js b/deps/weex-styler/lib/validator.js index 6185af7..d239fcb 100644 --- a/deps/weex-styler/lib/validator.js +++ b/deps/weex-styler/lib/validator.js @@ -659,8 +659,14 @@ var SHORTHAND_VALIDATOR = function SHORTHAND_VALIDATOR(v, validateFunction, isAr } var BORDER_VALIDATOR = function BORDER_VALIDATOR (value, name) { - value = (value || '').toString().trim() - const values = value.split(/\s+/) + value = (value || '').toString().trim(); + let values = ''; + const colorAttribute = value.match(/\(.*?\)/g); + if (colorAttribute && colorAttribute.length === 1) { + values = value.replace(colorAttribute[0], colorAttribute[0].replace(/\s+/g, '')).split(/\s+/); + } else { + values = value.split(/\s+/); + } const res = [] let hasError = false const reasons = [] -- Gitee