forked from javascript-tutorial/server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.js
More file actions
executable file
·46 lines (29 loc) · 816 Bytes
/
Copy pathclient.js
File metadata and controls
executable file
·46 lines (29 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
'use strict';
const should = require('should');
const MarkdownIt = require('markdown-it');
// compares removing spaces between tags
should.Assertion.add('html', function(str) {
this.obj.should.be.a.String;
str.should.be.a.String;
this.obj.trim().replace(/>\s+</g, '><').should.equal(str.trim().replace(/>\s+</g, '><'));
}, false);
function makeMd(options) {
const md = MarkdownIt({
blockTags: ['iframe']
});
require('../plugins/outlinedBlocks')(md);
require('../plugins/sourceBlocks')(md);
require('../plugins/blockTags/plugin')(md);
require('../plugins/blockTags/iframe')(md);
return md;
}
function render(text) {
const md = makeMd();
return md.render(text);
}
function parse(text) {
const md = makeMd();
return md.parse(text);
}
describe('MarkIt', function() {
});