How to make Jade stop HTML encoding element attributes, and produce a literal string value?

前端 未结 4 1771
太阳男子
太阳男子 2020-12-14 00:11

UPDATE Jade v0.24.0 fixes this with a != syntax for attributes. option(value!=\'<%= id %>\')


I\'m trying to bu

4条回答
  •  天命终不由人
    2020-12-14 00:39

    Derick has already mentioned that Jade added new feature for unescape HTML encoding in update, but I'd like to add some addendum for someone who might not recognize.

    - var html = ""
    | !{html} <-- Escaped
    | #{html} <-- Encoded
    

    from https://github.com/visionmedia/jade

提交回复
热议问题