From 88cdc0080374bc60cc232d11200efed6f8dd7dfa Mon Sep 17 00:00:00 2001 From: WangXinhai <18907191365@189.cn> Date: Sun, 1 Apr 2018 15:47:34 +0800 Subject: [PATCH] reserve color as string --- src/components/ThemePicker/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ThemePicker/index.vue b/src/components/ThemePicker/index.vue index ded41398..7ec4af06 100644 --- a/src/components/ThemePicker/index.vue +++ b/src/components/ThemePicker/index.vue @@ -71,7 +71,7 @@ export default { const value = newCluster[index] const color_plain = color.replace(/([()])/g,'\\$1') const repl = new RegExp(`(^|})([^{]+{[^{}]+)${color_plain}\\b([^}]*)(?=})`, 'gi') - const nestRepl = new RegExp(color, 'ig') // for greed matching before the 'color' + const nestRepl = new RegExp(color_plain, 'ig') // for greed matching before the 'color' let v while ((v = repl.exec(style))) { colorOverrides.push(v[2].replace(nestRepl, value) + value + v[3] + '}') // '}' not captured in the regexp repl to reserve it as locator-boundary