summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-markdown/test
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-04-02 15:01:49 +0200
committerSamy Pessé <samypesse@gmail.com>2016-12-22 15:00:44 +0100
commitd9bbc2fe0a280d05795594e49c22413a0b5b71c4 (patch)
tree5bcbf1a33a75666a21c89a5b646d9b55eec6258f /packages/gitbook-markdown/test
parente572570c43beee7b2df5aa562662290010bf2ab7 (diff)
downloadgitbook-d9bbc2fe0a280d05795594e49c22413a0b5b71c4.zip
gitbook-d9bbc2fe0a280d05795594e49c22413a0b5b71c4.tar.gz
gitbook-d9bbc2fe0a280d05795594e49c22413a0b5b71c4.tar.bz2
Don't escape code block if already in escaped block
Diffstat (limited to 'packages/gitbook-markdown/test')
-rw-r--r--packages/gitbook-markdown/test/page.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/gitbook-markdown/test/page.js b/packages/gitbook-markdown/test/page.js
index 8e253f6..6ed6d96 100644
--- a/packages/gitbook-markdown/test/page.js
+++ b/packages/gitbook-markdown/test/page.js
@@ -46,6 +46,13 @@ describe('Page parsing', function() {
);
});
+ it('should escape codeblocks with nunjucks tags in {% raw %} tags', function() {
+ assert.equal(
+ page.prepare('{% raw %}Hello {{ "Bonjour" }} ```test```{% endraw %}'),
+ '{% raw %}Hello {{ "Bonjour" }} ```test```{% endraw %}'
+ );
+ });
+
it('should not process math', function() {
assert.equal(page.prepare("Hello $world$"), "Hello $world$");
assert.equal(page.prepare("Hello $$world$$"), "Hello $$world$$");