mirror of https://github.com/keeweb/keeweb.git
tests: update mdToHtml with two additional arguments
arguments for breaks, gfm
This commit is contained in:
parent
070a1dfd48
commit
fed296c84c
|
@ -3,17 +3,17 @@ import { MdToHtml } from 'util/formatting/md-to-html';
|
|||
|
||||
describe('MdToHtml', () => {
|
||||
it('should convert markdown', () => {
|
||||
expect(MdToHtml.convert('## head\n_italic_')).to.eql({
|
||||
expect(MdToHtml.convert('## head\n_italic_', true, false)).to.eql({
|
||||
html: '<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({ text: 'plain\ntext' });
|
||||
expect(MdToHtml.convert('plain\ntext', true, false)).to.eql({ text: 'plain\ntext' });
|
||||
});
|
||||
|
||||
it('should convert links', () => {
|
||||
expect(MdToHtml.convert('[link](https://x)')).to.eql({
|
||||
expect(MdToHtml.convert('[link](https://x)', true, false)).to.eql({
|
||||
html:
|
||||
'<div class="markdown">' +
|
||||
'<p><a href="https://x" rel="noreferrer noopener" target="_blank">link</a></p>\n' +
|
||||
|
|
Loading…
Reference in New Issue