Skip to content

Commit

Permalink
Fix: Pages - vars {} -> ${}
Browse files Browse the repository at this point in the history
  • Loading branch information
fs5m8 committed Jan 13, 2023
1 parent ac96df6 commit 078250d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/client/app/common/views/components/page/page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class Script {
public interpolate(str: string) {
if (str == null) return null;
return str.replace(/${(.+?)}/g, match => {
const v = this.vars[match.slice(1, -1).trim()];
return str.replace(/\${(.+?)}/g, match => {
const v = this.vars[match.slice(2, -1).trim()];
return v == null ? 'NULL' : v.toString();
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/misc/aiscript/evaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export class ASEvaluator {

@autobind
private interpolate(str: string, scope: Scope) {
return str.replace(/${(.+?)}/g, match => {
const v = scope.getState(match.slice(1, -1).trim());
return str.replace(/\${(.+?)}/g, match => {
const v = scope.getState(match.slice(2, -1).trim());
return v == null ? 'NULL' : v.toString();
});
}
Expand Down

0 comments on commit 078250d

Please sign in to comment.