File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed
Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -45,16 +45,12 @@ const schema = {
4545export function parse ( file ) {
4646 const vfile = new VFile ( file . content ) ;
4747
48- try {
49- const parseOptions = {
50- customTags : [
51- "timestamp" , // Parse datetime fields according to YAML 1.1 spec
52- ] ,
53- } ;
54- matter ( vfile , { strip : true , yaml : parseOptions } ) ;
55- } catch ( _ ) {
56- throw new FrontmatterParseError ( file . name ) ;
57- }
48+ const parseOptions = {
49+ customTags : [
50+ "timestamp" , // Parse datetime fields according to YAML 1.1 spec
51+ ] ,
52+ } ;
53+ matter ( vfile , { strip : true , yaml : parseOptions } ) ;
5854
5955 const frontmatter = vfile . data . matter ;
6056
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ describe("md.parse", () => {
108108 try {
109109 await parse ( file ) ;
110110 } catch ( error ) {
111- expect ( error ) . toBeInstanceOf ( FrontmatterParseError ) ;
111+ expect ( error ) . toBeInstanceOf ( MissingFrontmatterError ) ;
112112 }
113113 } ) ;
114114
You can’t perform that action at this time.
0 commit comments