Oops, yes I missed the | at the end of the last line. Thanks for
taking the time to reply; however the | is not exactly related to the
problem at hand.
I have narrowed narrowed it down. The following haml template gives
the error "Syntax error on line 6: 4 spaces were used for indentation.
Haml must be indented using two spaces.":
%div
%div
= "blah blah blah blah blah " + |
"blah blah blah." |
= "blah"
If I remove the blank line between the two "=" statements, it compiles
fine.
If the statement above the blank line isn't a multiline statement, it
compiles fine.
If I add 4 spaces to the blank line (to match the indentation of the
other lines, even though other than whitespace there is nothing on
that line) it compiles fine.
I'm using haml 2.0.3, ruby 1.8.7-p22, and rails 2-1-stable.
Cheers,
Dave.
On Sep 28, 4:31 pm, Nathan Weizenbaum <[EMAIL PROTECTED]> wrote:
> The problem is caused by the multiline syntax. Haml multiline syntax
> requires the | to be used at the end of *each* line in the multiline
> block. So you should do
>
> stuff
> stuff
> = blah blah blah blah blah |
> blah blah blah blah |
>
> = blah
>
> See question three ofhttp://haml.hamptoncatlin.com/docs/rdoc/files/FAQ.html.
>
> Dave Rothlisberger wrote:
> > I have seen this error when you have blank lines in the template. I
> > can't remember the details, it may have had to do with multi-line
> > content (with the dreaded "|" line-joining syntax).
>
> > e.g. something like
>
> > stuff
> > stuff
> > = blah blah blah blah blah |
> > blah blah blah blah
>
> > = blah
>
> > Haml seemed to think the second "= blah" line was indented too far,
> > when in fact it was matching the previous indentation. Removing the
> > blank line fixed the problem for me.
>
> > Again, I can't remember the exact details so I don't have a working
> > test case for this. Are blank lines allowed or discouraged in haml?
>
> > Cheers
> > Dave.
>
> > On Sep 17, 11:01 am, Chris Eppstein <[EMAIL PROTECTED]> wrote:
>
> >> ActionView::TemplateError (4 spaces were used for indentation. Haml
> >> must be indented using exactly *two* spaces. Please go to line 7 of
> >> foo.sass,
> >> place the cursor before the first non-space character and press the
> >> backspace key 2 times. Then save the file.)
>
> >> ;-)
>
> >> On Sep 17, 8:35 am, Nathan Weizenbaum <[EMAIL PROTECTED]> wrote:
>
> >>> I'm not sure if I can be more clear than the error itself... Haml
> >>> requires two spaces for indentation. You used more than two spaces.
>
> >>> venkat wrote:
>
> >>>> ActionView::TemplateError (4 spaces were used for indentation. Haml
> >>>> must be indented using two spaces.)
>
> >>>> Thanks in advance
>
> >>>> -venkat
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---