mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Merge pull request #2461 from nixel2007/master
Adds escaping in {change} find
This commit is contained in:
commit
513e78758e
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]?
|
||||
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}"
|
||||
|
||||
|
|
Loading…
Reference in a new issue