mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
change little piece of frontmatter logic
This commit is contained in:
parent
8094af43d4
commit
baaa3fd148
1 changed files with 2 additions and 1 deletions
|
@ -187,6 +187,8 @@ module Middleman::CoreExtensions::FrontMatter
|
|||
def parse_front_matter(content)
|
||||
yaml_regex = /^(---\s*\n.*?\n?)^(---\s*$\n?)/m
|
||||
if content =~ yaml_regex
|
||||
content = content[($1.size + $2.size)..-1]
|
||||
|
||||
begin
|
||||
data = YAML.load($1)
|
||||
rescue => e
|
||||
|
@ -194,7 +196,6 @@ module Middleman::CoreExtensions::FrontMatter
|
|||
return false
|
||||
end
|
||||
|
||||
content = content.split(yaml_regex).last
|
||||
else
|
||||
return false
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue