We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent afb52d9 commit 35c0adbCopy full SHA for 35c0adb
1 file changed
scripts/validate.mjs
@@ -41,9 +41,15 @@ function parseFrontmatter(content) {
41
42
const block = normalized.slice(4, closing);
43
const fields = {};
44
+ let currentKey = null;
45
for (const line of block.split("\n")) {
- const match = line.match(/^(\w[\w-]*):\s*(.+)$/);
46
- if (match) fields[match[1]] = match[2].trim();
+ const match = line.match(/^(\w[\w-]*):\s*(.*)$/);
47
+ if (match) {
48
+ currentKey = match[1];
49
+ fields[currentKey] = match[2].trim();
50
+ } else if (currentKey && /^\s+\S/.test(line)) {
51
+ fields[currentKey] += " " + line.trim();
52
+ }
53
}
54
return fields;
55
0 commit comments