bem / bem-xjst

bem-xjst (eXtensible JavaScript Templates): declarative template engine for the browser and server
https://bem.github.io/bem-xjst
Other
116 stars 48 forks source link

BEMHTML: should trim and escape cls #190

Closed miripiruni closed 8 years ago

miripiruni commented 8 years ago
  it('should trim cls', function() {
    compile(function() {
      block('button').cls()('  btn  ');
    })
      .apply({ block: 'button' })
      .should.equal('<div class="button btn"></div>');
  });

  it('should escape cls', function() {
    compile(function() {
      block('button').cls()('url="a=b&c=d"');
    })
      .apply({ block: 'button' })
      .should.equal('<div class="button url=&quot;a=b&amp;c=d&quot;"></div>');
  });

Demo

miripiruni commented 8 years ago

Released in v6.5.1