[FIX] qweb: support attributes with quotes

closes #651
This commit is contained in:
Géry Debongnie
2020-02-20 10:28:02 +01:00
committed by aab-odoo
parent 20eb848262
commit 2c01802b8e
3 changed files with 42 additions and 2 deletions
+10
View File
@@ -51,6 +51,16 @@ describe("static templates", () => {
expect(renderToString(qweb, "test")).toBe(`<div class="abc">word</div>`);
});
test("div with a class attribute with a quote", () => {
qweb.addTemplate("test", `<div class="a'bc">word</div>`);
expect(renderToString(qweb, "test")).toBe(`<div class="a'bc">word</div>`);
});
test("div with an arbitrary attribute with a quote", () => {
qweb.addTemplate("test", `<div abc="a'bc">word</div>`);
expect(renderToString(qweb, "test")).toBe(`<div abc="a'bc">word</div>`);
});
test("div with a empty class attribute", () => {
qweb.addTemplate("test", `<div class="">word</div>`);
expect(renderToString(qweb, "test")).toBe(`<div>word</div>`);