2
votes

I've been trying to learn HAML by putting together a simple middleman app, but I keep running into syntax error. I'm using a bootstrap theme and followed a video tutorial, but it seems like I'm running into "illegal nesting" problems.

.container
    .jumbotron
        %blockquote
        %p Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
            %small
            Someone famous in
            %cite{:title => "Source Title"} Source Title

"Haml::SyntaxError at / Illegal nesting: content can't be both given on the same line as %p and nested within it."

I've been messing around with it to try and understand how the identation works, but have no clue. I can make the blockquote show up if I dont have a container.

Advice please!

1

1 Answers

2
votes
.container
    .jumbotron
        %blockquote
        %p 
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
            %small
            Someone famous in
            %cite{:title => "Source Title"} Source Title

Rule of thumb: if element has childs, it shouldn't have some text on the same line

P.S. I strongly recommend you 2 spaces indentation