This commit is contained in:
Knut Sveidqvist
2025-09-18 16:09:11 +02:00
parent 631edc06ef
commit ac8d92a5a4

View File

@@ -3,8 +3,7 @@
// Note that JS doesn't support the "\A" anchor, which means we can't use // Note that JS doesn't support the "\A" anchor, which means we can't use
// multiline mode. // multiline mode.
// Relevant YAML spec: https://yaml.org/spec/1.2.2/#914-explicit-documents // Relevant YAML spec: https://yaml.org/spec/1.2.2/#914-explicit-documents
export const frontMatterRegex = export const frontMatterRegex = /^\uFEFF?[\t ]*-{3}[\t ]*\r?\n([\S\s]*?)\r?\n-{3}[\t ]*(?:\r?\n|$)/;
/^\uFEFF?[\t ]*-{3}[\t ]*\r?\n([\S\s]*?)\r?\n[\t ]*-{3}[\t ]*(?:\r?\n|$)/;
export const directiveRegex = export const directiveRegex =
/%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi; /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;