This commit is contained in:
WangXinhai 2018-04-01 15:45:55 +08:00 committed by GitHub
parent 2ea0f80a2d
commit 385c021651
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -69,7 +69,8 @@ export default {
const colorOverrides = [] // only capture color overides
oldCluster.forEach((color, index) => {
const value = newCluster[index]
const repl = new RegExp(`(^|})([^{]+{[^{}]+)${color}\\b([^}]*)(?=})`, 'gi')
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'
let v
while ((v = repl.exec(style))) {