summaryrefslogtreecommitdiffstats
path: root/lib/output/modifiers/highlightCode.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-05-02 15:03:28 +0200
committerSamy Pessé <samypesse@gmail.com>2016-05-02 15:03:29 +0200
commit93d3f118910cc1ff2f46e8011c2df742210df087 (patch)
tree76af5b803408f4bcd772cbfa7a269c9b3280d6ab /lib/output/modifiers/highlightCode.js
parent59479f10fc5c3aef780d96e1ca39bc83f696d151 (diff)
downloadgitbook-93d3f118910cc1ff2f46e8011c2df742210df087.zip
gitbook-93d3f118910cc1ff2f46e8011c2df742210df087.tar.gz
gitbook-93d3f118910cc1ff2f46e8011c2df742210df087.tar.bz2
Fix js error when using node < 4.x
Diffstat (limited to 'lib/output/modifiers/highlightCode.js')
-rw-r--r--lib/output/modifiers/highlightCode.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/output/modifiers/highlightCode.js b/lib/output/modifiers/highlightCode.js
index dcd9d24..5d397bb 100644
--- a/lib/output/modifiers/highlightCode.js
+++ b/lib/output/modifiers/highlightCode.js
@@ -1,4 +1,6 @@
var is = require('is');
+var Immutable = require('immutable');
+
var Promise = require('../../utils/promise');
var editHTMLElement = require('./editHTMLElement');
@@ -9,7 +11,7 @@ var editHTMLElement = require('./editHTMLElement');
@return {String}
*/
function getLanguageForClass(classNames) {
- return classNames
+ return Immutable.List(classNames)
.map(function(cl) {
// Markdown
if (cl.search('lang-') === 0) {