feat: add md<->txt passthrough document converters

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-31 08:34:51 +02:00
co-authored by Claude Sonnet 5
parent 70c0c5ce6b
commit 756e875fd9
2 changed files with 32 additions and 0 deletions
+26
View File
@@ -141,4 +141,30 @@ describe('document converters', () => {
expect(result.value).toContain('first point');
expect(result.value).toContain('<li>');
}, 20000);
it('copies MD content unchanged to TXT', async () => {
const inputPath = path.join(tmpDir, 'fixture-for-txt.md');
const content = '# Heading\n\nSome **bold** text.\n';
await fs.writeFile(inputPath, content);
const outputPath = path.join(tmpDir, 'from-md.txt');
const entry = resolve('md', 'txt');
await entry.convert(inputPath, outputPath);
const output = await fs.readFile(outputPath, 'utf8');
expect(output).toBe(content);
});
it('copies TXT content unchanged to MD', async () => {
const inputPath = path.join(tmpDir, 'fixture-for-md-from-txt.txt');
const content = 'Plain text content.\n';
await fs.writeFile(inputPath, content);
const outputPath = path.join(tmpDir, 'from-txt.md');
const entry = resolve('txt', 'md');
await entry.convert(inputPath, outputPath);
const output = await fs.readFile(outputPath, 'utf8');
expect(output).toBe(content);
});
});