From dc63bdf0238a1e71567279a9efb12963d4e12930 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Tue, 16 Nov 2021 07:27:10 -0800 Subject: [PATCH] Docco 0.9.1 --- docco.js | 8 ++++++-- docco.litcoffee | 4 ++-- index.html | 4 ++-- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) 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 = `
${code}
`; 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 = "
#{code}
" 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-lock.json b/package-lock.json index 8494fea1..d8f559ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "docco", - "version": "0.9.0", + "version": "0.9.1", "lockfileVersion": 1, "requires": true, "dependencies": { 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",