Repository navigation
Expand file tree
/
Copy pathindex.js
More file actions
35 lines (32 loc) · 1.41 KB
/
Copy pathindex.js
File metadata and controls
35 lines (32 loc) · 1.41 KB
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
var path = require('path');
var tester = require('gitbook-tester');
var assert = require('assert');
var pkg = require('../package.json');
describe('emphasize', function() {
it('should correctly replace by span block', function() {
return tester.builder()
.withContent('#test me \n\nHello world. {% em %}highlight{% endem %}')
.withLocalPlugin(path.join(__dirname, '..'))
.withBookJson({
gitbook: pkg.engines.gitbook,
plugins: ['emphasize']
})
.create()
.then(function(result) {
assert.equal(result[0].content, '<h1 id="test-me">test me</h1>\n<p>Hello world. <span class="pg-emphasize pg-emphasize-yellow" style="">highlight</span></p>')
});
});
it('should accept inline markdown', function() {
return tester.builder()
.withContent('#test me \n\nHello world. {% em %}highlight **bold**{% endem %}')
.withLocalPlugin(path.join(__dirname, '..'))
.withBookJson({
gitbook: pkg.engines.gitbook,
plugins: ['emphasize']
})
.create()
.then(function(result) {
assert.equal(result[0].content, '<h1 id="test-me">test me</h1>\n<p>Hello world. <span class="pg-emphasize pg-emphasize-yellow" style="">highlight <strong>bold</strong></span></p>')
});
});
});