I am using node.js and express.j s to render an index.jade page which contains several script blocks taht contain templates to be used via backbone and underscore. The issue I am facing is that due to the inclusiong of <%= %> style variables within the templates, the Jade rendering is failing. The following code snippet causes a syntax error:
script#tpl-things-list-item(type='text/template')
td
a(href=<%= _id %>) link text
td <%= name %>
td <%= age %>
Note that it is only a problem when I use a variable inside the href value, if I remove the entire href, this snippet works just fine. Is there a way to work around this? I'd like to continue using Jade to define the templates as it is very concise but this is a show stopper.
Got it.
!!! 5
html(lang='en')
head
title= title
body
h1= "Hello World!"
script#tpl-things-list-item(type='text/template')
td
a(href!="<%= _id %>") link text
td <%= name %>
td <%= age %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With