I used html2haml.heroku.com and it turned some ordinary strings into the following:
A normal sentence is here
= succeed '.' do
%strong and it is cut off randomly by this succeed
Where the succeed
call seems unnecessary. Is this just an artifact from the html to haml conversion?
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.
In Haml, we write a tag by using the percent sign and then the name of the tag. This works for %strong , %div , %body , %html ; any tag you want. Then, after the name of the tag is = , which tells Haml to evaluate Ruby code to the right and then print out the return value as the contents of the tag.
If you try
A normal sentence is here
= succeed '.' do
%strong and it is cut off randomly by this succeed
and generate the HTML, the output will be like this:
A normal sentence is here
<strong>and it is cut off randomly by this succeed</strong>.
However, if you try something like
A normal sentence is here
%strong and it is cut off randomly by this succeed
.
You will have an output like this:
A normal sentence is here
<strong>and it is cut off randomly by this succeed</strong>
.
And white spaces are important in inline elements - please refer to my (late) answer in this question
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