adding colon inside string breaks gray-matter parsing
kartik-madhak opened this issue · comments
In my md file, I have this at the beginning:
+++
authors = ["ABC"]
categories = ["cat"]
date = 2023-04-14T00:00:00Z
description = "Title: something about title"
draft = false
+++
...
This results in error when I try to parse it like this:
const result = grayMatter(content, {
delimiters: '+++',
engines: { toml: toml.parse }
})
The error:
✖ Failed to compile template: filename.md
⚠ end of the stream or a document separator is expected at line 10, column 6:
title = "Title: something about title"
^
Is there a way to make the parser ignore the colon? Any help would be appreciated!
This worked:
const result = grayMatter(html, {
delimiters: ['+++', '+++'],
language: 'toml',
engines: { toml: toml.parse.bind(toml) }
})