pugjs / pug

Pug – robust, elegant, feature rich template engine for Node.js
https://pugjs.org
21.65k stars 1.96k forks source link

I can't not escape this! #150

Closed NHQ closed 13 years ago

NHQ commented 13 years ago

This is what is in my database (item.content):

<p><a href="http://vimeo.com/10738304" title=""1992" -- Paleo (Music Video)"><img src="http://b.vimeocdn.com/ts/570/702/57070214_200.jpg" alt=""1992" -- Paleo (Music Video)" /></a></p><p>Built from over 2000 handmade photo collages.<br /> <br /> Directed, animated, and photographed by Jared Varava.<br /> Produced by An Illusion of Movement.</p><p>Cast: <a href="http://vimeo.com/aiom" style="color: #2786c2; text-decoration: none;">An Illusion of Movement</a></p>

and when I try to run that through interpolation like

!{item.content}

It comes out looking just as above, HTML and all.

I also tried this but it didn't work either. Rendered tags and all.

.content != (item.content)

How do I make it do what it do, pls?

tj commented 13 years ago

.content!= item.content

should do, best not to store html in your db though that is kinda sloppy :p parse it up some more and reconstruct if possible, but yeah it should work

tj commented 13 years ago

in fact I know it does work, it has to, because everyone does body!= body for express stuff

NHQ commented 13 years ago

sonuvagun you did it. I thought I had tried all the possible variations. So no perens is it?

(yeah i know its sloppy, but it comes to me delivered like that.)

Thanks. You're the node man, man. Do you work for sencha?

tj commented 13 years ago

haha, yeah no need for parens, its just a js expression

foo!= "foo" + " bar"

is valid for example, might have been due to the space before !=. Not anymore no, I work for LearnBoost