Commit be02af42 authored by derek-knox's avatar derek-knox

Add catch during manual yaml front matter editing

parent e38e3363
import jsYaml from 'js-yaml';
import { noop } from 'lodash';
const NEW_LINE = '\n';
......@@ -39,7 +40,12 @@ export const frontMatterify = source => {
}
const matterStr = source.slice(index, offset);
const matter = jsYaml.safeLoad(matterStr);
let matter;
try {
matter = jsYaml.safeLoad(matterStr);
} catch (error) {
noop();
}
let content = source.slice(offset + delimiter.length);
let spacing = '';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment