diff options
author | Samy Pesse <samypesse@gmail.com> | 2015-09-14 11:21:16 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2015-09-14 11:21:16 +0200 |
commit | 35c4179ca12a0287279ced0535f11237cdf606ec (patch) | |
tree | 3c33389aee37d515b2fed396f57a7cefb2eb8cad /lib/utils/page.js | |
parent | 601ce3add380392fe9c1d598e01f05034ff058c3 (diff) | |
download | gitbook-35c4179ca12a0287279ced0535f11237cdf606ec.zip gitbook-35c4179ca12a0287279ced0535f11237cdf606ec.tar.gz gitbook-35c4179ca12a0287279ced0535f11237cdf606ec.tar.bz2 |
Use block code for highlight pre/code
Cleanup correctly predefined blocks
Diffstat (limited to 'lib/utils/page.js')
-rw-r--r-- | lib/utils/page.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/utils/page.js b/lib/utils/page.js index 2400480..c4af715 100644 --- a/lib/utils/page.js +++ b/lib/utils/page.js @@ -223,7 +223,7 @@ function normalizeHtml(src, options) { // Highlight code blocks $("code").each(function() { - // Extract language + // Normalize language var lang = _.chain( ($(this).attr("class") || "").split(" ") ) @@ -240,11 +240,10 @@ function normalizeHtml(src, options) { .first() .value(); - if (lang) { - var html = $(this).text(); + var source = $(this).text(); + var html = options.book.template.applyBlock('code', source).body; - $(this).html(html); - } + $(this).html(html); }); // Replace glossary terms |