Haml: Control whitespace around text

前端 未结 13 2147
时光说笑
时光说笑 2020-11-30 16:38

In my Rails template, I\'d like to accomplish final HTML to this effect using HAML:

I will first link somewhere         


        
13条回答
  •  庸人自扰
    2020-11-30 17:33

    You can use the 'aligator syntax' of HAML

    Whitespace Removal: > and <

    and < give you more control over the whitespace near a tag. > will remove all whitespace surrounding a tag, while < will remove all whitespace immediately within a tag. You can think of them as alligators eating the whitespace: > faces out of the tag and eats the whitespace on the outside, and < faces into the tag and eats the whitespace on the inside. They’re placed at the end of a tag definition, after class, id, and attribute declarations but before / or =.

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

提交回复
热议问题