Rescue exception when parsing invalid yaml. Prevents silent fail in auto and server mode
This commit is contained in:
parent
0a58d78338
commit
226c7cc121
|
@ -26,7 +26,11 @@ module Jekyll
|
|||
if self.content =~ /^(---\s*\n.*?\n?)^(---\s*$\n?)/m
|
||||
self.content = self.content[($1.size + $2.size)..-1]
|
||||
|
||||
self.data = YAML.load($1)
|
||||
begin
|
||||
self.data = YAML.load($1)
|
||||
rescue => e
|
||||
puts "YAML Exception: #{e.message}"
|
||||
end
|
||||
end
|
||||
|
||||
self.data ||= {}
|
||||
|
|
Loading…
Reference in New Issue