Skip to content

Commit

Permalink
BEMHTML: do not exec modes if tag or bem is false (issue #509)
Browse files Browse the repository at this point in the history
  • Loading branch information
miripiruni committed Mar 16, 2018
1 parent 8083fab commit 3c01bfa
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions lib/bemhtml/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,31 @@ Entity.prototype.defaultBody = function(context) {
context.mods = this.mods.exec(context);
if (context.ctx.elem) context.elemMods = this.elemMods.exec(context);

var bem;
var cls;
var attrs;
var js;
var mix;
var tag = this.tag.exec(context);

if (tag !== false) {
cls = this.cls.exec(context);
attrs = this.attrs.exec(context);
bem = this.bem.exec(context);
if (bem !== false) {
js = this.js.exec(context);
mix = this.mix.exec(context);
}
}

return this.bemxjst.render(context,
this,
this.tag.exec(context),
this.js.exec(context),
this.bem.exec(context),
this.cls.exec(context),
this.mix.exec(context),
this.attrs.exec(context),
tag,
js,
bem,
cls,
mix,
attrs,
this.content.exec(context),
context.mods,
context.elemMods);
Expand Down

0 comments on commit 3c01bfa

Please sign in to comment.