diff --git a/index.js b/index.js index 7d49331..7f50f75 100644 --- a/index.js +++ b/index.js @@ -97,6 +97,10 @@ function parseMatter(file, options) { // get the raw front-matter block file.matter = str.slice(0, closeIndex); + // fix trailing '\r' on windows + if (file.matter.endsWith('\r')) { + file.matter = file.matter.slice(0, -1); + } const block = file.matter.replace(/^\s*#[^\n]+/gm, '').trim(); if (block === '') {