fix replacement for 2+ variables
This commit is contained in:
@@ -13,7 +13,7 @@ function getHintText(hint: GameHint): string {
|
||||
if (hint.rawText) {
|
||||
// Replace the variable names used in the hint with the ones used by the player
|
||||
// variable names are marked like `«{g}»` inside the text.
|
||||
return hint.rawText.replace(/«\{(.*?)\}»/, ((_, v) =>
|
||||
return hint.rawText.replaceAll(/«\{(.*?)\}»/g, ((_, v) =>
|
||||
// `hint.varNames` contains tuples `[oldName, newName]`
|
||||
(hint.varNames.find(x => x[0] == v))[1]))
|
||||
} else {
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
"downlevelIteration": true,
|
||||
"experimentalDecorators": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"lib": [
|
||||
"ES2021.String"
|
||||
]
|
||||
},
|
||||
"exclude": ["server", "relay"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user