This is a paragraph
'); +}); + +test('renderMarkdown converts bold text', () => { + const markdown = '**Bold Text**'; + const result = renderMarkdown(markdown); + assert.equal(result, 'Bold Text
'); +}); + +test('renderMarkdown converts italic text', () => { + const markdown = '*Italic Text*'; + const result = renderMarkdown(markdown); + assert.equal(result, 'Italic Text
'); +}); + +test('renderMarkdown converts link with target and class', () => { + const markdown = '[Link](https://example.com)'; + const result = renderMarkdown(markdown); + assert.equal( + result, + '' + ); +}); + +test('renderMarkdown handles multiple links', () => { + const markdown = 'Check [first link](https://first.com) and [second link](https://second.com)'; + const result = renderMarkdown(markdown); + assert.ok( + result.includes('first link') && + result.includes('second link') + ); +}); + +test('renderMarkdown handles empty input', () => { + const markdown = ''; + const result = renderMarkdown(markdown); + assert.equal(result, ''); +}); + +test('renderMarkdown handles special characters', () => { + const markdown = 'Text withText with <special> characters & symbols
'); +}); + +test('renderMarkdown preserves link title attribute', () => { + const markdown = '[Link with title](https://example.com "Title")'; + const result = renderMarkdown(markdown); + assert.equal( + result, + '' + ); +}); \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..0bf1d39 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "moduleResolution": "NodeNext", + "target": "ES2020", + "outDir": "./dist", + "esModuleInterop": true, + "strict": true, + "declaration": true, + "sourceMap": true + }, + "include": ["src/**/*", "test/**/*"] + } \ No newline at end of file