HAML - what does the “!=” operator do?

前端 未结 3 1663
说谎
说谎 2021-01-23 10:51

I am looking at some seemlingly standard Haml code right now, but just noticed it starts off with a \"!=\", and 5 minutes of googling has failed to give me the answer for what

相关标签:
3条回答
  • 2021-01-23 11:28

    Same as using = but doesn't sanitize the HTML

    See http://haml.info/docs/yardoc/file.REFERENCE.html#unescaping_html

    != "Look  <up>!"
    

    compiles to

    Look <up>!
    

    instead of

    Look &ltg;up&gt;
    
    0 讨论(0)
  • 2021-01-23 11:45

    That is used for Unescaping html

    0 讨论(0)
  • 2021-01-23 11:46

    Read this HAML Documentation. It will give you all the answers you require. I just searched for HAML tags.

    Do a CTRL+F for !=. != basically valuates Ruby code just like the equals would

    0 讨论(0)
提交回复
热议问题