How can I render inline JavaScript with Jade / Pug?
simply use a 'script' tag with a dot after.
script. var users = !{JSON.stringify(users).replace(/<\//g, "<\\/")}
https://github.com/pugjs/pug/blob/master/examples/dynamicscript.pug
The :javascript
filter was removed in version 7.0
The docs says you should use a script
tag now, followed by a .
char and no preceding space.
Example:
script. if (usingJade) console.log('you are awesome') else console.log('use jade')
will be compiled to
<script> if (usingJade) console.log('you are awesome') else console.log('use jade')</script>