mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] qweb: t-esc inside t-call using outside t-set
Before this commit, the generated code was incorrect, and crashed, when there was a t-esc="abc" in a subtemplate, with t-set="abc" done outside the subtemplate, with syntax <t t-set="abc">value</t>.
This commit is contained in:
committed by
Géry Debongnie
parent
b8d3618afa
commit
2af8cccd65
@@ -207,6 +207,13 @@ describe("t-esc", () => {
|
||||
const result = renderToString(qweb, "test", { state: { list: [1, 2] } });
|
||||
expect(result).toBe("<span>1,2</span>");
|
||||
});
|
||||
|
||||
test("t-esc inside t-call, with t-set outside", () => {
|
||||
qweb.addTemplate("main", `<div><t t-set="v">Hi</t><t t-call="sub"/></div>`);
|
||||
qweb.addTemplate("sub", `<span t-esc="v"/>`);
|
||||
const result = renderToString(qweb, "main");
|
||||
expect(result).toBe("<div><span>Hi</span></div>");
|
||||
});
|
||||
});
|
||||
|
||||
describe("t-raw", () => {
|
||||
|
||||
Reference in New Issue
Block a user