Reputation: 403
Is there a use case for !{} - string interpolation, unescaped? Given that it is risky to use?
I have checked the following links:
https://pugjs.org/language/interpolation.html#string-interpolation-unescaped
Using !{ } and #{ } interpolation in a jade template (exclamation-object, hash-object)
https://www.reddit.com/r/node/comments/8kcz7s/can_someone_explain_the_difference_between/
Upvotes: 0
Views: 893
Reputation: 326
Simply put from the doc : never trust user input
so answering your question
use !{}
only when it's user input or some code you don't trust
Upvotes: 1