added assignment to handle nil code values
This commit is contained in:
parent
97a971897f
commit
4c4ef24222
@ -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