mirror of
https://github.com/SharpeTronics/jekyll-spaceship.git
synced 2025-12-21 00:03:17 -05:00
fix: empty element and regex matching issue
This commit is contained in:
parent
afd203b121
commit
512b9a89ed
@ -53,7 +53,9 @@ module Jekyll::Spaceship
|
||||
next element.remove_attribute if val.nil?
|
||||
if val.kind_of? Array
|
||||
next if val.size != 2
|
||||
val = element[prop].sub(/#{val[0]}/, val[1])
|
||||
v = element[prop]
|
||||
v = '' if v.nil?
|
||||
val = v.sub(/#{val[0]}/, val[1])
|
||||
elsif val.kind_of? Hash
|
||||
result = []
|
||||
val.each { |k, v| result.push "#{k}: #{v}" }
|
||||
@ -64,7 +66,7 @@ module Jekyll::Spaceship
|
||||
|
||||
# processing children
|
||||
return unless data.has_key?('children')
|
||||
return element.inner_html = nil if data['children'].nil?
|
||||
return element.inner_html = "" if data['children'].nil?
|
||||
children = self.create_children({
|
||||
:doc => doc,
|
||||
:data => data['children']
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user