teelou teelou - 1 year ago 85
Node.js Question

Jade template - does not process json in curly bracket after upgrading to pug?

Why jade does not process json properly anymore after upgrading to pug?

For instance:

a.btn.btn-link(href="/datasets/#{dataset.index}") Show


<a class="btn btn-link" href="/datasets/#{dataset.index}">Show</a>

It should be:

<a class="btn btn-link" href="/datasets/ISIUSXSXX">Show</a>

Any ideas why?


I think this is it:


I seriously don't understand why would a developer chooses pug/jade - the the 'code' looks utterly ugly and unreadable! Just a rant!

Guy Guy
Answer Source

The syntax has changed to use ES6 template strings:




Reference issue

We removed support for interpolation in attributes since it was unnecessarily complex in implementation and tended to delay users learning that they can just use any JavaScript value in place of attributes