inline tag in haml

前端 未结 5 1966
余生分开走
余生分开走 2021-01-31 15:31

In html, you can do something like this

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eget aliquet odio. Fusce id quam eu augu

5条回答
  •  离开以前
    2021-01-31 16:28

    I know this is old. But figured I'd post this in case anyone lands here. You can also do this sort of thing in haml (And maybe more what the OP was looking for?).

    %p Here is some text I want to #{content_tag(:em, "emphasize!")}, and here the word #{content_tag(:strong, "BOLD")} is in bold. and #{link_to("click here", "url")} for a link.
    

    Useful for those situations where doing it on multiple lines adds spaces you don't want I.E. When you have a link at the end of a sentence, and don't want that stupid space between the link and the period. (or like in the OP's example, there would be a space between the and the comma.

    Just don't get carried away like i did in the example :)

提交回复
热议问题