Skip to content

Commit

Permalink
BEMHTML: should properly render unescaped html field if tag:false p…
Browse files Browse the repository at this point in the history
…resent (fix for #312)
  • Loading branch information
miripiruni committed Jul 15, 2016
1 parent 21bc431 commit 184a659
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bemxjst/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
Expand Down
8 changes: 8 additions & 0 deletions test/runtime-escaping-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,12 @@ describe('Content escaping', function() {
{ html: { toString: function () { return '<lol>'; } } } ],
'<div></div><div></div>');
});

it('should ignore `tag:false` if html field exist', function() {
test(function() {}, {
tag: false,
html: '<script>console.log("hello html");</script>'
},
'<script>console.log("hello html");</script>');
});
});

0 comments on commit 184a659

Please sign in to comment.