fix(cli): honor an explicitly empty string input (#4113)

Co-authored-by: Your Name <you@example.com>
This commit is contained in:
hhang
2026-10-06 08:56:05 -06:00
committed by GitHub
co-authored by Your Name
parent 6bbac0cdb7
commit ec3a4e511a
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -153,7 +153,7 @@ export async function main(nodeProcess) {
}
async function getData() {
if (string) {
if (string !== undefined) {
return string;
}
if (input) {
+6
View File
@@ -98,6 +98,12 @@ describe('bin/marked', () => {
args: ['--string', '# test'],
stdout: '<h1>test</h1>',
}));
it('--string accepts empty input instead of reading stdin', testInput({
args: ['--string', ''],
stdin: '# ignored',
stdout: '\n',
}));
});
describe('config', () => {