Fix JSON parser for gray-matter.
This commit is contained in:
parent
ebf91a9800
commit
335dd15e6d
@ -10,7 +10,7 @@ function inferFrontmatterFormat(str) {
|
|||||||
case "+++":
|
case "+++":
|
||||||
return { language: "toml", delimiters: "+++", engines: { toml: tomlEng.parse.bind(tomlEng) } };
|
return { language: "toml", delimiters: "+++", engines: { toml: tomlEng.parse.bind(tomlEng) } };
|
||||||
case "{":
|
case "{":
|
||||||
return { language: "json", delimiters: ["{", "}"] };
|
return { language: "json", delimiters: ["{", "}"], engines: { json: ((input) => matter.engines.json.parse('{' + input + '}')) } };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user