From 4c4ef2422211a008f99928914851f6994442f25a Mon Sep 17 00:00:00 2001 From: Zachary Patten Date: Wed, 1 Jun 2011 12:33:08 -0500 Subject: [PATCH] added assignment to handle nil code values --- lib/rocco/layout.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/rocco/layout.rb b/lib/rocco/layout.rb index fa2b44c..5034cca 100644 --- a/lib/rocco/layout.rb +++ b/lib/rocco/layout.rb @@ -18,6 +18,7 @@ class Rocco::Layout < Mustache def sections num = 0 @doc.sections.map do |docs,code| + code ||= '' is_header = /^(.+)<\/h.>$/.match( docs ) header_text = is_header && is_header[1].split.join("_") num += 1