[FIX] qweb: renderToString now properly escape

closes #565
This commit is contained in:
Géry Debongnie
2019-12-11 11:49:28 +01:00
committed by aab-odoo
parent 97d8b3ed8c
commit b96ea79f2b
5 changed files with 58 additions and 18 deletions
+2 -5
View File
@@ -123,11 +123,8 @@ export function renderToString(
context: EvalContext = {},
extra?: any
): string {
const node = renderToDOM(qweb, t, context, extra);
const result = node instanceof Text ? node.textContent! : node.outerHTML;
if (result !== qweb.renderToString(t, context, extra)) {
throw new Error("HTML string returned by renderToString helper does not match QWeb render");
}
const result = qweb.renderToString(t, context, extra);
expect(qweb.templates[t].fn.toString()).toMatchSnapshot();
return result;
}