Merge pull request #50 from zpatten/master
Fix for crash when code is nil in lib/rocco/layout.rb, sections method.
This commit is contained in:
commit
a175735f0c
@ -18,6 +18,7 @@ class Rocco::Layout < Mustache
|
|||||||
def sections
|
def sections
|
||||||
num = 0
|
num = 0
|
||||||
@doc.sections.map do |docs,code|
|
@doc.sections.map do |docs,code|
|
||||||
|
code ||= ''
|
||||||
is_header = /^<h.>(.+)<\/h.>$/.match( docs )
|
is_header = /^<h.>(.+)<\/h.>$/.match( docs )
|
||||||
header_text = is_header && is_header[1].split.join("_")
|
header_text = is_header && is_header[1].split.join("_")
|
||||||
num += 1
|
num += 1
|
||||||
|
Loading…
Reference in New Issue
Block a user