brotherSoo
brotherSoo

Reputation: 37

Render tag to Jade

I want to render a tag with link to a jade file, but it shows me the code text, not the link.

I have tried pipe but it doesn't work either with or without the pipe.

contents.jade

div
  p 
   |#{DUL}

contents.js

var DUL = `a(href='/contents/delete_process') delete`
response.render('contents', DUL: DUL);

Upvotes: 1

Views: 48

Answers (1)

tom
tom

Reputation: 10601

To render html markup in pug you have to interpolate it with an exclamation mark !{var} like this:

div
  p 
   |!{DUL}

And change the value from DUL to

var DUL = '<a href="/contents/delete_process">delete</a>';

Upvotes: 1

Related Questions