We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 493984b commit ccde54fCopy full SHA for ccde54f
src/lib/frontmatter.js
@@ -7,7 +7,8 @@ import yaml from 'yaml';
7
* @returns {{title: string, description: string, body: string, meta: object}}
8
*/
9
export function parseFrontmatter(content, path = '') {
10
- const FRONT_MATTER_REG = /^\s*---\n\s*([\s\S]*?)\s*\n---\n/i;
+ // Accept both LF and CRLF line endings so frontmatter is detected on Windows
11
+ const FRONT_MATTER_REG = /^\s*---\r?\n\s*([\s\S]*?)\s*\r?\n---\r?\n/i;
12
13
const matches = content.match(FRONT_MATTER_REG);
14
if (!matches) {
0 commit comments