[REF] qweb: drop support of #{.} string interpolation

We only support the {{.}} syntax.

Part of #128
This commit is contained in:
Aaron Bohy
2019-06-07 08:58:02 +02:00
committed by Géry Debongnie
parent e14a4fe338
commit b14d069ee7
4 changed files with 8 additions and 34 deletions
+4 -8
View File
@@ -777,15 +777,11 @@ export class Context {
if (matches && matches[0].length === s.length) {
return `(${this.formatExpression(s.slice(2, -2))})`;
}
matches = s.match(/\#\{.*?\}/g);
if (matches && matches[0].length === s.length) {
return `(${this.formatExpression(s.slice(2, -1))})`;
}
let formatter = expr => "${" + this.formatExpression(expr) + "}";
let r = s
.replace(/\{\{.*?\}\}/g, s => formatter(s.slice(2, -2)))
.replace(/\#\{.*?\}/g, s => formatter(s.slice(2, -1)));
let r = s.replace(
/\{\{.*?\}\}/g,
s => "${" + this.formatExpression(s.slice(2, -2)) + "}"
);
return "`" + r + "`";
}
}