From 97cd1c141139a59122803500734a30841b867e41 Mon Sep 17 00:00:00 2001 From: Eliott Appleford Date: Thu, 24 Sep 2015 20:27:36 +0100 Subject: [PATCH] Fix JSON frontmatter parsing --- middleman-core/lib/middleman-core/util/data.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/middleman-core/lib/middleman-core/util/data.rb b/middleman-core/lib/middleman-core/util/data.rb index e05d4d82..8780e609 100644 --- a/middleman-core/lib/middleman-core/util/data.rb +++ b/middleman-core/lib/middleman-core/util/data.rb @@ -24,7 +24,7 @@ module Middleman::Util::Data end / - \A(.*?coding:.*?\n)? + \A(.*?coding:.*?\r?\n)? (?[-;]{3})[ ]*\r?\n (?.*?)[ ]*\r?\n? (?^[-.;]{3})[ ]*\r?\n? @@ -44,7 +44,7 @@ module Middleman::Util::Data when %w(--- ---), %w(--- ...) [parse_yaml(frontmatter, full_path), additional_content] when %w(;;; ;;;) - [parse_json(frontmatter, full_path), additional_content] + [parse_json("{#{frontmatter}}", full_path), additional_content] else [{}, content] end