support dynamic formatted attributes with dashes

This commit is contained in:
Géry Debongnie
2019-03-05 08:35:19 +01:00
parent b15761de8b
commit 484692b53a
3 changed files with 22 additions and 1 deletions
+5 -1
View File
@@ -425,7 +425,11 @@ export class QWeb {
}
if (name.startsWith("t-attf-")) {
const attName = name.slice(7);
let attName = name.slice(7);
if (!attName.match(/^[a-zA-Z]+$/)) {
// attribute contains 'non letters' => we want to quote it
attName = '"' + attName + '"';
}
const formattedExpr = value!.replace(
/\{\{.*?\}\}/g,
s => "${" + this._formatExpression(s.slice(2, -2)) + "}"