summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-markdown/test
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-03-08 10:22:15 +0100
committerSamy Pessé <samypesse@gmail.com>2016-12-22 15:00:37 +0100
commita7695cf02fcff28bcc7af530c42b858702e66165 (patch)
tree5f02f60195459aaa7f496204497b000dd2a3a801 /packages/gitbook-markdown/test
parent2516137d4e2b59b728f8562edb0e4c929aa6c5f8 (diff)
downloadgitbook-a7695cf02fcff28bcc7af530c42b858702e66165.zip
gitbook-a7695cf02fcff28bcc7af530c42b858702e66165.tar.gz
gitbook-a7695cf02fcff28bcc7af530c42b858702e66165.tar.bz2
Use markdown-renderer instead of regex
Diffstat (limited to 'packages/gitbook-markdown/test')
-rw-r--r--packages/gitbook-markdown/test/page.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/packages/gitbook-markdown/test/page.js b/packages/gitbook-markdown/test/page.js
index 67c209d..3bc5cd2 100644
--- a/packages/gitbook-markdown/test/page.js
+++ b/packages/gitbook-markdown/test/page.js
@@ -21,20 +21,21 @@ describe('Page parsing', function() {
});
it('should escape codeblocks in preparation (1)', function() {
- assert.equal(page.prepare("Hello `world`"), "Hello {% raw %}`world`{% endraw %}");
- assert.equal(page.prepare("Hello `world test`"), "Hello {% raw %}`world test`{% endraw %}");
- assert.equal(page.prepare("Hello ```world test```"), "Hello {% raw %}```world test```{% endraw %}");
- assert.equal(page.prepare("Hello\n```js\nworld test\n```\n"), "Hello\n{% raw %}```js\nworld test\n```{% endraw %}\n");
+ assert.equal(page.prepare("Hello `world`"), "\nHello {% raw %}`world`{% endraw %}\n");
+ assert.equal(page.prepare("Hello `world test`"), "\nHello {% raw %}`world test`{% endraw %}\n");
+ assert.equal(page.prepare("Hello ```world test```"), "\nHello {% raw %}`world test`{% endraw %}\n");
+ assert.equal(page.prepare("Hello\n```js\nworld test\n```\n"), "\nHello\n{% raw %}\n```js\nworld test\n```\n{% endraw %}");
+ assert.equal(page.prepare("Hello\n```\ntest\n\tworld\n\ttest\n```"), "\nHello\n{% raw %}\n```\ntest\n world\n test\n```\n{% endraw %}");
});
it('should escape codeblocks in preparation (2)', function() {
assert.equal(
page.prepare("Hello\n\n\n\tworld\n\thello\n\n\ntest"),
- "Hello\n{% raw %}\n\n\tworld\n\thello\n\n\n{% endraw %}test"
+ "\nHello\n{% raw %}\n```\nworld\nhello\n```\n{% endraw %}\ntest\n"
);
assert.equal(
page.prepare("Hello\n\n\n\tworld\n\thello\n\n\n"),
- "Hello\n{% raw %}\n\n\tworld\n\thello\n\n\n{% endraw %}"
+ "\nHello\n{% raw %}\n```\nworld\nhello\n```\n{% endraw %}"
);
});
});