summaryrefslogtreecommitdiffstats
path: root/lib/utils
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-03-23 11:00:50 +0100
committerSamy Pessé <samypesse@gmail.com>2015-03-23 11:00:50 +0100
commit63ee94ff89d10e56d82079183c494f8129b92eae (patch)
treea25891df1d80a7e819e0892459cd6bb3300deaa1 /lib/utils
parent7d9dc08a382d2fb82074aa0ca7544c8929261a0e (diff)
downloadgitbook-63ee94ff89d10e56d82079183c494f8129b92eae.zip
gitbook-63ee94ff89d10e56d82079183c494f8129b92eae.tar.gz
gitbook-63ee94ff89d10e56d82079183c494f8129b92eae.tar.bz2
Ignore codeblocks when replacing glossary terms
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/page.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/utils/page.js b/lib/utils/page.js
index 3c7d0b0..499c9a8 100644
--- a/lib/utils/page.js
+++ b/lib/utils/page.js
@@ -242,6 +242,9 @@ function normalizeHtml(src, options) {
var includedInFiles = false;
$("*").each(function() {
+ // Ignore codeblocks
+ if (_.contains(["code", "pre"], this.name.toLowerCase())) return;
+
replaceText($, this, r, function(match) {
// Add to files index in glossary
if (!includedInFiles) {