Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/lib/frontmatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import yaml from 'yaml';
* @returns {{title: string, description: string, body: string, meta: object}}
*/
export function parseFrontmatter(content, path = '') {
// Accept both LF and CRLF line endings so frontmatter is detected on Windows
const FRONT_MATTER_REG = /^\s*---\r?\n\s*([\s\S]*?)\s*\r?\n---\r?\n/i;
const FRONT_MATTER_REG = /^\s*---\n\s*([\s\S]*?)\s*\n---\n/i;

const matches = content.match(FRONT_MATTER_REG);
if (!matches) {
Expand Down