summaryrefslogtreecommitdiffstats
path: root/lib/utils
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-09-22 22:41:13 +0200
committerSamy Pessé <samypesse@gmail.com>2015-09-22 22:41:13 +0200
commit4e4bd23e2b4f6c54cf0caaf9cb3e7316d80c7f92 (patch)
tree12922020f454cffe71590e7693c2329784693b4a /lib/utils
parent62d0eb606eddfcb9a87b1447dd2e7bf8b389987f (diff)
downloadgitbook-4e4bd23e2b4f6c54cf0caaf9cb3e7316d80c7f92.zip
gitbook-4e4bd23e2b4f6c54cf0caaf9cb3e7316d80c7f92.tar.gz
gitbook-4e4bd23e2b4f6c54cf0caaf9cb3e7316d80c7f92.tar.bz2
Handle html param from code block output
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/page.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/utils/page.js b/lib/utils/page.js
index a17c6a2..2c57421 100644
--- a/lib/utils/page.js
+++ b/lib/utils/page.js
@@ -244,14 +244,15 @@ function normalizeHtml(src, options) {
.value();
var source = $(this).text();
- var html = options.book.template.applyBlock("code", {
+ var blk = options.book.template.applyBlock("code", {
body: source,
kwargs: {
language: lang
}
- }).body;
+ });
- $(this).html(html);
+ if (blk.html === false) $(this).text(blk.body);
+ else $(this).html(blk.body);
});
// Replace glossary terms