Jade Converts & To & When Javascript Is Used
I've just started using Harp 0.30.1 which comes with Jade installed as a pre-processor. So I'm just starting with Jade, too. I have a folder containing a set of files with filename
Solution 1:
You can use the unescaped string interpolation syntax (!{variable}
) instead of the regular string interpolation syntax (#{variable}
) in order to get those non-breaking spaces to render.
In your case:
a(href= fileName) !{trim(fileName)}
But keep in mind this word of warning from the Pug documentation:
Caution
Keep in mind that buffering unescaped content into your templates can be mighty risky if that content comes fresh from your users. Never trust user input!
Post a Comment for "Jade Converts & To & When Javascript Is Used"