Fix JSON parser for gray-matter.

This commit is contained in:
Caleb 2017-09-13 19:46:45 -06:00
parent ebf91a9800
commit 335dd15e6d

View File

@ -10,7 +10,7 @@ function inferFrontmatterFormat(str) {
case "+++":
return { language: "toml", delimiters: "+++", engines: { toml: tomlEng.parse.bind(tomlEng) } };
case "{":
return { language: "json", delimiters: ["{", "}"] };
return { language: "json", delimiters: ["{", "}"], engines: { json: ((input) => matter.engines.json.parse('{' + input + '}')) } };
}
}