Skip to content

heredoc breaks rocco #40

nstielau opened this Issue Apr 12, 2011 · 5 comments

3 participants



I've looked at this for a while, but don't have a great solution and am moving on. Something as simple as

heredoc <<-EOH
# comment

will break rocco. The 'code' for this section ends up being nil, after the "" runs, and layout.rb breaks with bad nil checks. The simple fix is to do better nil checks in layout.rb, specifically for 'code?' and 'empty?' in the sections method.


I've seen this as well. It's a pretty hard problem to solve for the current implementation. We'd almost need a language parsetree to handle it properly.


Yeah, that's about where I got. If the root cause is tough, what do you think about adding better nil checks and printing a warning to stderr? It's a pain that rocco a) breaks when it doesn't need to, and b) leads down a rabbithole to rdiscount's C. I'll make an attempt if you're interested.

p.s. I'm working on something to Rocco-ize a whole Chef repo (, I'm loving the *occo documentation style and tools. Thanks.

@mikewest mikewest was assigned Apr 13, 2011

Breaking things is bad. I also don't have any good ideas about a real solution... That said, I'll take a look at layout.rb right now to see about making things less broken.


I lied. I'll commit a fake solution in a moment. Please test it for me. :)


Works for my files that were failing before. Thanks for the fast turnaround. Lemme know if there is anything else I can to do help.

@nstielau nstielau closed this Aug 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.