Skip to content

Commit 0cef37f

Browse files
bertdeblockkategengler
authored andcommitted
Don't replace null in RFC content
1 parent 4dd16f3 commit 0cef37f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

lib/frontmatter-updater.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ module.exports = class FrontmatterUpdater {
1212
throw new Error(`Could not parse frontmatter: ${JSON.stringify(errors)}`);
1313
}
1414

15-
let output = frontmatter.stringify(content, merge(data, metadata, { arrayMerge: unionMerge }));
16-
return output.replaceAll(' null', '');
15+
let frontmatterContent = frontmatter
16+
.stringify('', merge(data, metadata, { arrayMerge: unionMerge }))
17+
.replaceAll(': null', ':')
18+
.trim();
19+
20+
return [frontmatterContent, content].join('\n');
1721
}
1822
};
1923

test/frontmatter-updater-test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ prs:
1717
1818
## My heading
1919
20-
Foo bar baz
20+
Foo bar baz null
2121
`;
2222

2323
const readyForReleaseMarkdown = `---
@@ -36,7 +36,7 @@ prs:
3636
3737
## My heading
3838
39-
Foo bar baz
39+
Foo bar baz null
4040
`;
4141

4242
const updatedDeepKeysMarkdown = `---
@@ -58,7 +58,7 @@ prs:
5858
5959
## My heading
6060
61-
Foo bar baz
61+
Foo bar baz null
6262
`;
6363

6464
describe('FrontmatterUpdater', function () {

0 commit comments

Comments
 (0)