From 184a659371d974488a823c887e82441aee0316d3 Mon Sep 17 00:00:00 2001 From: miripiruni Date: Fri, 15 Jul 2016 13:49:47 +0300 Subject: [PATCH] BEMHTML: should properly render unescaped html field if `tag:false` present (fix for #312) --- lib/bemxjst/index.js | 2 +- test/runtime-escaping-test.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/bemxjst/index.js b/lib/bemxjst/index.js index d20b50b3..3a4736f8 100644 --- a/lib/bemxjst/index.js +++ b/lib/bemxjst/index.js @@ -277,9 +277,9 @@ BEMXJST.prototype._run = function _run(context) { else if ( context.html && typeof context.html === 'string' && + !context.tag && typeof context.block === 'undefined' && typeof context.elem === 'undefined' && - typeof context.tag === 'undefined' && typeof context.cls === 'undefined' && typeof context.attrs === 'undefined' ) diff --git a/test/runtime-escaping-test.js b/test/runtime-escaping-test.js index 7f4a0843..32ec2c2f 100644 --- a/test/runtime-escaping-test.js +++ b/test/runtime-escaping-test.js @@ -58,4 +58,12 @@ describe('Content escaping', function() { { html: { toString: function () { return ''; } } } ], '
'); }); + + it('should ignore `tag:false` if html field exist', function() { + test(function() {}, { + tag: false, + html: '' + }, + ''); + }); });