summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-markdown/test/page.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-20 15:31:59 +0100
committerSamy Pessé <samypesse@gmail.com>2016-12-22 15:00:51 +0100
commitdbee17ddec2e786fbf02572e7bf6050c207b492f (patch)
tree8d93bd8eb985e3bd8132612935bc5a1583fe15e3 /packages/gitbook-markdown/test/page.js
parent9b3888005d5098079056fa889a84e75cf3c57670 (diff)
downloadgitbook-dbee17ddec2e786fbf02572e7bf6050c207b492f.zip
gitbook-dbee17ddec2e786fbf02572e7bf6050c207b492f.tar.gz
gitbook-dbee17ddec2e786fbf02572e7bf6050c207b492f.tar.bz2
Use gitbook-html as base parser
Diffstat (limited to 'packages/gitbook-markdown/test/page.js')
-rw-r--r--packages/gitbook-markdown/test/page.js21
1 files changed, 9 insertions, 12 deletions
diff --git a/packages/gitbook-markdown/test/page.js b/packages/gitbook-markdown/test/page.js
index 8f4b5c5..8b882d8 100644
--- a/packages/gitbook-markdown/test/page.js
+++ b/packages/gitbook-markdown/test/page.js
@@ -4,25 +4,22 @@ var assert = require('assert');
var page = require('../').page;
-function loadPage (name, options) {
- var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/' + name + '.md'), 'utf8');
- return page(CONTENT, options).sections;
-}
-
-var LEXED = loadPage('PAGE');
describe('Page parsing', function() {
- it('should detect sections', function() {
- assert.equal(LEXED.length, 1);
+ var LEXED;
+
+ before(function() {
+ var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/PAGE.md'), 'utf8');
+ LEXED = page(CONTENT);
});
- it('should gen content for normal sections', function() {
- assert(LEXED[0].content);
+ it('should gen content', function() {
+ assert(LEXED.content);
});
it('should not add id to headings', function() {
- assert.equal(page('# Hello').sections[0].content, '<h1>Hello</h1>\n');
- assert.equal(page('# Hello {#test}').sections[0].content, '<h1 id="test">Hello </h1>\n');
+ assert.equal(page('# Hello').content, '<h1>Hello</h1>\n');
+ assert.equal(page('# Hello {#test}').content, '<h1 id="test">Hello </h1>\n');
});
it('should escape codeblocks in preparation (1)', function() {