beno / slim-mustache

MIT License
4 stars 0 forks source link

More than one attribute between slashes does not render #5

Open omensinger opened 7 years ago

omensinger commented 7 years ago

If I have more than one attribute in one line separated by slashes, slim-mustache ignores all attributes.

Working example using Mustache with Javascript:

console.log(Mustache.render('<img src="/img/{{a}}/{{b}}" />', {'a':'x', 'b':'1.jpg'}));
=> <img src="/img/x/1.jpg" />

Problem with slim-mustache:

img src="/img/~a/~b"
=> <img src="/img/{{a/~b}}" />

Using just one attribute it gets rendered:

img src="/img/~a"
=> img src="/img/x"

And

img src="/img/~b"
=> img src="/img/1.jpg"

This is how it looks like using spaces (but would not work because of the spaces):

img src="/img/ ~a/ ~b"
=> <img src="/img/ {{a}}/ {{b}}" />

This behavior isn't intended, isn't it?!