Printing (or unescaping JSON) with nodejs and jade

pug

Solution

Maybe upgrade to more recent version of Jade?

I'm using version 0.25.0 and..

This is escaped

=JSON.stringify(item)

These are unescaped

!{JSON.stringify(item)}
!=JSON.stringify(item)

Problem

I've been digging through Jade documentation and google searches but nothing words. I'm attempting to print a JSON string with a view but no matter how I try to print the variable, the double quotes are always converted to `"` Update: I'm using Jade 0.26.0. My test json: ``` {test:"value"} ``` My template code: ``` !{JSON.stringify(json)} ``` Raw output in the web browser: ``` {"test":"value"} ```

Original source