Skip to content

Commit

Permalink
Merge pull request #981 from sbmaxx/issues/980@v2
Browse files Browse the repository at this point in the history
Use single quote #980
  • Loading branch information
Vladimir Varankin committed Apr 16, 2015
2 parents 2ccc593 + 7466353 commit 5efd217
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions common.blocks/i-bem/i-bem.bemhtml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ BEM.INTERNAL = {
})(BEM_);

var buildEscape = (function() {
var ts = { '"' : '&quot;', '&' : '&amp;', '<' : '&lt;', '>' : '&gt;' },
var ts = { '"' : '&quot;', '&' : '&amp;', '<' : '&lt;', '>' : '&gt;', '\'' : '&#39;' },
f = function(t) { return ts[t] || t; };
return function(r) {
r = new RegExp(r, 'g');
Expand Down Expand Up @@ -227,6 +227,7 @@ BEMContext.prototype.identify = (function() {

BEMContext.prototype.xmlEscape = buildEscape('[&<>]');
BEMContext.prototype.attrEscape = buildEscape('["&<>]');
BEMContext.prototype.jsAttrEscape = buildEscape('[\'&]');

BEMContext.prototype.BEM = BEM_;

Expand Down Expand Up @@ -425,9 +426,9 @@ def()(function() {
}

if(isBEM && jsParams) {
this._str += ' data-bem="' +
this.attrEscape(JSON.stringify(jsParams)) +
'"';
this._str += ' data-bem=\'' +
this.jsAttrEscape(JSON.stringify(jsParams)) +
'\'';
}

var attrs = apply('attrs');
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div class="b-nojs__run"><table class="b-nojs"><b><i><div class="b-nojs__eee"><b>blalba</b></div><div class="b2__eee"><b>blalba</b></div><yay class="b-bla b-bla_0-mode_v2 b-bla_m2_v2 i-bem" data-bem="{&quot;b-bla&quot;:{}}"></yay><div class="b-alb i-bem" data-bem="{&quot;b-alb&quot;:{&quot;bbb&quot;:1,&quot;title&quot;:2}}" bbb="1" title="2"></div></i></b></table></div>
<div class="b-nojs__run"><table class="b-nojs"><b><i><div class="b-nojs__eee"><b>blalba</b></div><div class="b2__eee"><b>blalba</b></div><yay class="b-bla b-bla_0-mode_v2 b-bla_m2_v2 i-bem" data-bem='{"b-bla":{}}'></yay><div class="b-alb i-bem" data-bem='{"b-alb":{"bbb":1,"title":2}}' bbb="1" title="2"></div></i></b></table></div>

0 comments on commit 5efd217

Please sign in to comment.