mirror of
https://github.com/markedjs/marked.git
synced 2026-11-30 16:48:05 +01:00
fix(cli): honor an explicitly empty string input (#4113)
Co-authored-by: Your Name <you@example.com>
This commit is contained in:
+1
-1
@@ -153,7 +153,7 @@ export async function main(nodeProcess) {
|
||||
}
|
||||
|
||||
async function getData() {
|
||||
if (string) {
|
||||
if (string !== undefined) {
|
||||
return string;
|
||||
}
|
||||
if (input) {
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user