diff options
author | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-04-16 13:15:35 -0700 |
---|---|---|
committer | Aaron O'Mullan <aaron.omullan@friendco.de> | 2014-04-16 13:15:35 -0700 |
commit | 52610d7d61d30d77bb6aaddf68c6fdfe1f5c6ae1 (patch) | |
tree | c8f51dfd116ea7d4f9a5009085e9b31f4b16af2b | |
parent | 9e4b393b7a77b3fa782edfb2ced0f5776f05997c (diff) | |
download | gitbook-52610d7d61d30d77bb6aaddf68c6fdfe1f5c6ae1.zip gitbook-52610d7d61d30d77bb6aaddf68c6fdfe1f5c6ae1.tar.gz gitbook-52610d7d61d30d77bb6aaddf68c6fdfe1f5c6ae1.tar.bz2 |
Disable automatic highlighting
Fallback to no highlighting rather that potentially funky highlighting
-rw-r--r-- | lib/parse/page.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/parse/page.js b/lib/parse/page.js index efadf82..b6c9994 100644 --- a/lib/parse/page.js +++ b/lib/parse/page.js @@ -23,11 +23,13 @@ function render(section, _options) { // Synchronous highlighting with highlight.js highlight: function (code, lang) { + if(!lang) return code; + try { return hljs.highlight(lang, code).value; - } catch(e) { - return hljs.highlightAuto(code).value; - } + } catch(e) { } + + return code; } }); |