mirror of https://github.com/keeweb/keeweb.git
md-to-html test
This commit is contained in:
parent
5cac16a632
commit
4f53e39f8d
|
@ -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(
|
||||
'<div class="markdown"><h2>head</h2>\n<p><em>italic</em></p>\n</div>'
|
||||
);
|
||||
});
|
||||
|
||||
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(
|
||||
'<div class="markdown">' +
|
||||
'<p><a href="https://x" rel="noreferrer noopener" target="_blank">link</a></p>\n' +
|
||||
'</div>'
|
||||
);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue