diff --git a/addons/base/static/qweb/qweb-test-output.xml b/addons/base/static/qweb/qweb-test-output.xml index 6bb6c887b52..2660e519273 100644 --- a/addons/base/static/qweb/qweb-test-output.xml +++ b/addons/base/static/qweb/qweb-test-output.xml @@ -23,4 +23,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/base/static/qweb/qweb-test.js.html b/addons/base/static/qweb/qweb-test.js.html index 9500453c228..dfe7d225285 100644 --- a/addons/base/static/qweb/qweb-test.js.html +++ b/addons/base/static/qweb/qweb-test.js.html @@ -40,6 +40,20 @@ equals('[<ok>]', render('escf-format-variable-with-escapes', {value: ''}), "Render a formatted string with data to escape"); }); + test("Basic unescaped output", function () { + equals("ok", render('raw-literal', {}), "Render a literal string"); + equals("ok", render('raw-variable', {ok: 'ok'}), "Render a string variable"); + equals("", render('raw-notescaped', {ok: ''}), "Render a string with data not escaped"); + }); + test("Formatted unescaped output", function () { + equals("ok", render('rawf-noformat-literal', {}), "Render a literal string"); + equals("ok", render('rawf-simpleformat-variable', {value: 'ok'}), + "Only render an interpolated variable"); + equals("[ok]", render('rawf-format-variable', {value: 'ok'}), + "Actually formatted variable"); + equals('[]', render('rawf-format-variable-notescaped', {value: ''}), + "Render a formatted string with data not escaped"); + }); }); diff --git a/addons/base/static/qweb/qweb.js b/addons/base/static/qweb/qweb.js index e8a614f4104..a114371b1c7 100644 --- a/addons/base/static/qweb/qweb.js +++ b/addons/base/static/qweb/qweb.js @@ -174,7 +174,7 @@ var QWeb = { return this.eval_str(t_att["raw"], v); }, render_tag_rawf:function(e, t_att, g_att, v) { - return this.eval_format(t_att["raw"], v); + return this.eval_format(t_att["rawf"], v); }, render_tag_esc:function(e, t_att, g_att, v) { return this.escape_text(this.eval_str(t_att["esc"], v));