You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Plates 0.4.8, it seems that tags with multiple class names can make mappings fail.
Here I’ve tried to bind the href attribute of an <a> tag. It works, but only if the tag has just one class name. If the tag has multiple class names, it fails.
varPlates=require('plates');varhtml='<a class="class1 class2" href="#">Foo</a>';vardata={'url': 'http://google.com/'};// *** TEST 1// doesn't work at allvarmap1=Plates.Map();map1.class('class1').use('url').as('href');console.log(Plates.bind(html,data,map1));// *** TEST 2// remove the "as" clause// result: does something but not what I want it to dovarmap2=Plates.Map();map2.class('class1').use('url');console.log(Plates.bind(html,data,map2));// *** TEST 3// remove the additional class name// result: works, but I had to get rid of a class that I might wanthtml='<a class="class1" href="#">Foo</a>';varmap3=Plates.Map();map3.class('class1').use('url').as('href');console.log(Plates.bind(html,data,map3));
The text was updated successfully, but these errors were encountered:
Using Plates 0.4.8, it seems that tags with multiple class names can make mappings fail.
Here I’ve tried to bind the
href
attribute of an<a>
tag. It works, but only if the tag has just one class name. If the tag has multiple class names, it fails.The text was updated successfully, but these errors were encountered: