diff --git a/test/src/formatting/md-to-html.js b/test/src/formatting/md-to-html.js new file mode 100644 index 00000000..28bea140 --- /dev/null +++ b/test/src/formatting/md-to-html.js @@ -0,0 +1,22 @@ +import { expect } from 'chai'; +import { MdToHtml } from 'util/formatting/md-to-html'; + +describe('MdToHtml', () => { + it('should convert markdown', () => { + expect(MdToHtml.convert('## head\n_italic_')).to.eql( + '

head

\n

italic

\n
' + ); + }); + + it('should not add markdown wrapper tags for plaintext', () => { + expect(MdToHtml.convert('plain\ntext')).to.eql('plain\ntext'); + }); + + it('should convert links', () => { + expect(MdToHtml.convert('[link](https://x)')).to.eql( + '
' + + '

link

\n' + + '
' + ); + }); +});