Correct offenses reported by RuboCop 1.6.0

This commit is contained in:
Ashwin Maroli 2020-12-09 23:07:40 +05:30
parent 84deb286ed
commit c70437e2de
2 changed files with 2 additions and 2 deletions

View File

@ -41,7 +41,7 @@ module Jekyll
begin
self.content = File.read(filename, **Utils.merged_file_read_opts(site, opts))
if content =~ Document::YAML_FRONT_MATTER_REGEXP
self.content = $POSTMATCH
self.content = Regexp.last_match.post_match
self.data = SafeYAML.load(Regexp.last_match(1))
end
rescue Psych::SyntaxError => e

View File

@ -483,7 +483,7 @@ module Jekyll
def read_content(**opts)
self.content = File.read(path, **Utils.merged_file_read_opts(site, opts))
if content =~ YAML_FRONT_MATTER_REGEXP
self.content = $POSTMATCH
self.content = Regexp.last_match.post_match
data_file = SafeYAML.load(Regexp.last_match(1))
merge_data!(data_file, :source => "YAML front matter") if data_file
end