[英]When to use string interpolation, unescaped !{} in pug?
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 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/ https://www.reddit.com/r/node/comments/8kcz7s/can_someone_explain_the_difference_between/
Simply put from the doc: never trust user input
so answering your question use !{}
only when it's not user input or some code you don't trust从文档中简单地说: never trust user input
,所以回答您的问题时使用!{}
仅当它不是用户输入或您不信任的某些代码时
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.