fix replacement for 2+ variables

This commit is contained in:
Jon Eugster
2024-02-29 16:53:35 +01:00
parent 217f86ce5e
commit 68f84a3426
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -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 {