Adds escaping in {change} find
This commit is contained in:
parent
a2bbc9c893
commit
9b4c7b3fdc
1 changed files with 2 additions and 1 deletions
|
@ -45,7 +45,8 @@ for file in dir when not (file in ['locale.coffee', 'en.coffee'])
|
||||||
if commentsMap[enCat]? and commentsMap[enCat][enTag]?
|
if commentsMap[enCat]? and commentsMap[enCat][enTag]?
|
||||||
comment = " \##{commentsMap[enCat][enTag]}"
|
comment = " \##{commentsMap[enCat][enTag]}"
|
||||||
|
|
||||||
if fileSource.search(new RegExp("#? #{enTag}: \"#{tag}\".*\{change\}.*")) >= 0 and comment.search(/.*\{change\}/) < 0
|
escapedTag = tag.replace /[-\/\\^$*+?.()|[\]{}]/g, "\\$&"
|
||||||
|
if fileSource.search(new RegExp("#? #{enTag}: \"#{escapedTag}\".*\{change\}.*")) >= 0 and comment.search(/.*\{change\}/) < 0
|
||||||
comment = " \#" + comment if comment is ""
|
comment = " \#" + comment if comment is ""
|
||||||
comment = comment + " {change}"
|
comment = comment + " {change}"
|
||||||
|
|
||||||
|
|
Reference in a new issue