tests: update mdToHtml with two additional arguments

arguments for breaks, gfm
This commit is contained in:
Aetherinox 2024-04-25 19:44:26 -07:00
parent 070a1dfd48
commit fed296c84c
No known key found for this signature in database
GPG Key ID: CB5C4C30CD0D4028
1 changed files with 3 additions and 3 deletions

View File

@ -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' +