New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
content_for helper disrupts Haml indentation #331
Comments
I could not reproduce this bug.
Compilation is succesful.
|
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] haml (4.0.3) Almost exactly the same. Could there be something else that is throwing On Thu, Sep 19, 2013 at 5:07 AM, bood-pvb notifications@github.com 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 ) |
Take a look at PR #337 for some background on this nanoc bug. |
Fixed as part of #337. The fix will be included in 3.6.6. If you want to have the fix now, put this in your Gemfile and run gem 'nanoc', :github => 'nanoc/nanoc', :branch => 'release-3.6.x' |
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:
https://s3.amazonaws.com/code_share/indent.zip
Just unzip the file, run
bundle
, thennanoc compile
and you should see the same error.In the file
content/projects/client-1.haml
, I use acontent_for
block to capture some content. It then gets rendered out on thecontent/portfolio.haml
page.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
_ga
partial, then the error does go away.There's an unusual interaction going on that I'm having some difficulty tracking down. Any ideas?
Regards,
Eric
The text was updated successfully, but these errors were encountered: