Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
content_for helper disrupts Haml indentation #331
Okay, this is a very strange issue that seems inconsistent and difficult to reproduce. I have one project that this error doesn't occur on and one where it always does.
The error that I get is the typical Haml indentation error. It looks like this:
What brings it about is more random. Here is a link to a minimal nanoc site that recreates the issue:
Just unzip the file, run
In the file
If you get rid of the capture block on the client page, then the error does not go away. If you get rid of where the captured content is rendered out on the portfolio page, then the error does go away. Here's the strange one. If you go into the default layout and remove the line that renders the
There's an unusual interaction going on that I'm having some difficulty tracking down. Any ideas?
That's very strange. I still get the error. Here are the versions I'm using:
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-darwin11.4.2]
Almost exactly the same. Could there be something else that is throwing
On Thu, Sep 19, 2013 at 5:07 AM, bood-pvb firstname.lastname@example.org wrote:
Yes, very strange. Haml is a pure ruby => maybe a problem in the implementation
Anyway, Exception raise a specific piece of code in haml parser module.
def plain(line, escape_html = nil) if block_opened? raise SyntaxError.new(Error.message(:illegal_nesting_plain), @next_line.index) end
look the next one
def block_opened? @next_line.tabs > @line.tabs end def tabs @tabs ||= parser.compute_tabs(self) end
And so on.
Time to debug )