diff --git a/addons/web/doc/qweb.rst b/addons/web/doc/qweb.rst index 61668dcb9be..a8225a72fee 100644 --- a/addons/web/doc/qweb.rst +++ b/addons/web/doc/qweb.rst @@ -312,15 +312,6 @@ Output Evaluates, html-escapes and outputs ``content``. -.. _qweb-directive-escf: - -.. function:: t-escf=content - - :param Format content: - - Similar to :ref:`t-esc ` but evaluates a - ``Format`` instead of just an expression. - .. _qweb-directive-raw: .. function:: t-raw=content @@ -331,14 +322,6 @@ Output html-escape the result of evaluating ``content``. Should only ever be used for known-secure content, or will be an XSS attack vector. -.. _qweb-directive-rawf: - -.. function:: t-rawf=content - - :param Format content: - - ``Format``-based version of :ref:`t-raw `. - .. _qweb-directive-att: .. function:: t-att=map diff --git a/addons/web/static/lib/qweb/qweb-test-output.xml b/addons/web/static/lib/qweb/qweb-test-output.xml index 2660e519273..1135ad9f251 100644 --- a/addons/web/static/lib/qweb/qweb-test-output.xml +++ b/addons/web/static/lib/qweb/qweb-test-output.xml @@ -10,20 +10,6 @@ - - - - - - - - - - - - - - @@ -34,18 +20,4 @@ - - - - - - - - - - - - - - diff --git a/addons/web/static/lib/qweb/qweb-test.js.html b/addons/web/static/lib/qweb/qweb-test.js.html index 02ec89c134c..469641a1796 100644 --- a/addons/web/static/lib/qweb/qweb-test.js.html +++ b/addons/web/static/lib/qweb/qweb-test.js.html @@ -32,29 +32,11 @@ equals(render('esc-variable', {ok: 'ok'}), "ok", "Render a string variable"); equals(render('esc-toescape', {ok: ''}), "<ok>", "Render a string with data to escape"); }); - test("Formatted escaped output", function () { - equals(render('escf-noformat-literal', {}), "ok", "Render a literal string"); - equals(render('escf-simpleformat-variable', {value: 'ok'}), "ok", - "Only render an interpolated variable"); - equals(render('escf-format-variable', {value: 'ok'}), "[ok]", - "Actually formatted variable"); - equals(render('escf-format-variable-with-escapes', {value: ''}), '[<ok>]', - "Render a formatted string with data to escape"); - }); test("Basic unescaped output", function () { equals(render('raw-literal', {}), "ok", "Render a literal string"); equals(render('raw-variable', {ok: 'ok'}), "ok", "Render a string variable"); equals(render('raw-notescaped', {ok: ''}), "", "Render a string with data not escaped"); }); - test("Formatted unescaped output", function () { - equals(render('rawf-noformat-literal', {}), "ok", "Render a literal string"); - equals(render('rawf-simpleformat-variable', {value: 'ok'}), "ok", - "Only render an interpolated variable"); - equals(render('rawf-format-variable', {value: 'ok'}), "[ok]", - "Actually formatted variable"); - equals(render('rawf-format-variable-notescaped', {value: ''}), '[]', - "Render a formatted string with data not escaped"); - }); module("Context-setting tests", { setup: function () { diff --git a/addons/web/static/lib/qweb/qweb2.js b/addons/web/static/lib/qweb/qweb2.js index 4512b749682..0289af91a60 100644 --- a/addons/web/static/lib/qweb/qweb2.js +++ b/addons/web/static/lib/qweb/qweb2.js @@ -28,7 +28,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. var QWeb2 = { expressions_cache: {}, RESERVED_WORDS: 'true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,this,typeof,eval,void,Math,RegExp,Array,Object,Date'.split(','), - ACTIONS_PRECEDENCE: 'foreach,if,call,set,esc,escf,raw,rawf,js,debug,log'.split(','), + ACTIONS_PRECEDENCE: 'foreach,if,call,set,esc,raw,js,debug,log'.split(','), WORD_REPLACEMENT: { 'and': '&&', 'or': '||', @@ -735,15 +735,9 @@ QWeb2.Element = (function() { compile_action_esc : function(value) { this.top("r.push(context.engine.tools.html_escape(" + (this.format_expression(value)) + "));"); }, - compile_action_escf : function(value) { - this.top("r.push(context.engine.tools.html_escape(" + (this.string_interpolation(value)) + "));"); - }, compile_action_raw : function(value) { this.top("r.push(" + (this.format_expression(value)) + ");"); }, - compile_action_rawf : function(value) { - this.top("r.push(" + (this.string_interpolation(value)) + ");"); - }, compile_action_js : function(value) { this.top("(function(" + value + ") {"); this.bottom("})(dict);");