escape frontmatter content so it handles newlines

This commit is contained in:
Luke Westby 2020-01-07 09:33:40 -08:00 committed by GitHub
parent 28df968c36
commit 5785d45f66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,8 +19,8 @@ function toEntry(entry, includeBody) {
return `
( [${fullPath.join(", ")}]
, { frontMatter = """${entry.metadata}
""" , body = ${body(entry, includeBody)}
, { frontMatter = ${JSON.stringify(entry.metadata)}
, body = ${body(entry, includeBody)}
, extension = "${extension}"
} )
`;