mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-30 17:28:29 -05:00
fix error for case with broken encoding
This commit is contained in:
@@ -25,14 +25,16 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing.
|
||||
def read_yaml(base, name)
|
||||
self.content = File.read(File.join(base, name))
|
||||
|
||||
begin
|
||||
self.content = File.read(File.join(base, name))
|
||||
|
||||
if self.content =~ /\A(---\s*\n.*?\n?)^(---\s*$\n?)/m
|
||||
self.content = $POSTMATCH
|
||||
self.data = YAML.load($1)
|
||||
end
|
||||
rescue Exception => e
|
||||
rescue => e
|
||||
puts "Error reading file #{name}: #{e.message}"
|
||||
rescue SyntaxError => e
|
||||
puts "YAML Exception reading #{name}: #{e.message}"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user