Merge pull request #2461 from nixel2007/master

Adds escaping in {change} find
This commit is contained in:
Nick Winter 2015-03-03 13:30:15 -08:00
commit 513e78758e

View file

@ -45,7 +45,8 @@ for file in dir when not (file in ['locale.coffee', 'en.coffee'])
if commentsMap[enCat]? and 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 + " {change}"