In html, you can do something like this
<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eget aliquet odio. Fusce id quam eu augue sollicitudin imperdiet eu ac eros. <em>Etiam nec nisi lorem</em>, ac venenatis ipsum. In sollicitudin, lectus eget varius tincidunt, felis sapien porta eros, non pellentesque dui quam vitae tellus. </p>
It is nice, because the paragraph of text still looks like a paragraph in the markup. In haml, it looks like this
%p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eget aliquet odio. Fusce id quam eu augue sollicitudin imperdiet eu ac eros. %em Etiam nec nisi lorem , ac venenatis ipsum. In sollicitudin, lectus eget varius tincidunt, felis sapien porta eros, non pellentesque dui quam vitae tellus.
Is there any way to totally inline a tag in haml?
There are mainly two ways to include JavaScript in HTML: Internal/Inline: By using “script” element in the “head” or “body” section. External: By using an external JavaScript file.
Haml Comments: -#The hyphen followed immediately by the pound sign signifies a silent comment. Any text following this isn't rendered in the resulting document at all.
Haml is a markup language predominantly used with Ruby that cleanly and simply describes the HTML of any web document without the use of inline code. It is a popular alternative to using Rails templating language (. erb) and allows you to embed Ruby code into your markup.
Haml excels for structural markup, but it's not really intended for inline markup. Read: Haml Sucks for Content. Just put your inline tags as HTML:
.content %p Lorem ipsum <em>dolor</em> sit amet.
Or else use a filter:
.content :markdown Lorem ipsum *dolor* sit amet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With