[FIX] qweb: renderToString should not escape twice text content

Since commit
https://github.com/odoo/owl/commit/b2f12a111524f37348b142ac248813f9cb25ca2e,
Owl escape text content twice. It seems that it was done to prevent
security issues, but without realizing that the standard t-esc method
already escapes.

closes #708
This commit is contained in:
Géry Debongnie
2021-12-14 15:16:53 +01:00
committed by aab-odoo
parent bc04f727ac
commit c06049076a
2 changed files with 4 additions and 13 deletions
+1 -1
View File
@@ -163,7 +163,7 @@ describe("t-esc", () => {
test("escaping", () => {
qweb.addTemplate("test", `<span><t t-esc="var"/></span>`);
expect(renderToString(qweb, "test", { var: "<ok>abc</ok>" })).toBe(
"<span>&amp;lt;ok&amp;gt;abc&amp;lt;/ok&amp;gt;</span>"
"<span>&lt;ok&gt;abc&lt;/ok&gt;</span>"
);
});