diff --git a/docco.js b/docco.js
index 9666bc56..6c9aceac 100644
--- a/docco.js
+++ b/docco.js
@@ -198,7 +198,9 @@
highlight: function(code, lang) {
lang || (lang = language.name);
if (highlightjs.getLanguage(lang)) {
- return highlightjs.highlight(lang, code).value;
+ return highlightjs.highlight(code, {
+ language: lang
+ }).value;
} else {
console.warn(`docco: couldn't highlight code block with unknown language '${lang}' in ${source}`);
return code;
@@ -208,7 +210,9 @@
results = [];
for (i = j = 0, len = sections.length; j < len; i = ++j) {
section = sections[i];
- code = highlightjs.highlight(language.name, section.codeText).value;
+ code = highlightjs.highlight(section.codeText, {
+ language: language.name
+ }).value;
code = code.replace(/\s+$/, '');
section.codeHtml = `
`;
results.push(section.docsHtml = marked(section.docsText));
diff --git a/docco.litcoffee b/docco.litcoffee
index 3b632685..7c43a8d4 100644
--- a/docco.litcoffee
+++ b/docco.litcoffee
@@ -181,14 +181,14 @@ if not specified.
lang or= language.name
if highlightjs.getLanguage(lang)
- highlightjs.highlight(lang, code).value
+ highlightjs.highlight(code, {language: lang}).value
else
console.warn "docco: couldn't highlight code block with unknown language '#{lang}' in #{source}"
code
}
for section, i in sections
- code = highlightjs.highlight(language.name, section.codeText).value
+ code = highlightjs.highlight(section.codeText, {language: language.name}).value
code = code.replace(/\s+$/, '')
section.codeHtml = ""
section.docsHtml = marked(section.docsText)
diff --git a/index.html b/index.html
index 26891c94..e255c54e 100644
--- a/index.html
+++ b/index.html
@@ -221,14 +221,14 @@ Main Documentation Generation F
lang or= language.name
if highlightjs.getLanguage(lang)
- highlightjs.highlight(lang, code).value
+ highlightjs.highlight(code, {language: lang}).value
else
console.warn "docco: couldn't highlight code block with unknown language '#{lang}' in #{source}"
code
}
for section, i in sections
- code = highlightjs.highlight(language.name, section.codeText).value
+ code = highlightjs.highlight(section.codeText, {language: language.name}).value
code = code.replace(/\s+$/, '')
section.codeHtml = "<div class='highlight'><pre>#{code}</pre></div>"
section.docsHtml = marked(section.docsText)
diff --git a/package.json b/package.json
index 508e5911..193dd7bd 100644
--- a/package.json
+++ b/package.json
@@ -9,7 +9,7 @@
"coffeescript"
],
"author": "Jeremy Ashkenas",
- "version": "0.9.0",
+ "version": "0.9.1",
"license": "MIT",
"repository": {
"type": "git",