asciidoctor-prism-extension
Advanced tools
Comparing version 2.0.4 to 2.0.5
11
index.js
@@ -40,3 +40,3 @@ 'use strict'; | ||
module.exports = { | ||
initialize (name, backend, {$$smap: {document}}) { | ||
initialize (name, backend, {document}) { | ||
const languages = getDocumentLanguages(document); | ||
@@ -57,3 +57,3 @@ | ||
if (typeof lang === 'string' && Prism.languages[lang] === undefined) { | ||
if (lang && Prism.languages[lang] === undefined) { | ||
const {languages} = this; | ||
@@ -68,4 +68,7 @@ const source = node.lines.join('\n'); | ||
highlight (node, content, lang) { | ||
return typeof lang === 'string' ? Prism.highlight(content, Prism.languages[lang]) | ||
.replace(/____(\d+)____/gi, '<b class="conum">($1)</b>') : content; | ||
return lang | ||
? Prism.highlight( | ||
content, Prism.languages[lang] | ||
).replace(/____(\d+)____/gi, '<b class="conum">($1)</b>') | ||
: content; | ||
}, | ||
@@ -72,0 +75,0 @@ |
{ | ||
"name": "asciidoctor-prism-extension", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "Highlight Asciidoc code listings with Prism.js, server side, with no front-end dependencies.", | ||
@@ -37,7 +37,7 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@asciidoctor/core": "^2.0.0-rc.3" | ||
"@asciidoctor/core": "^2.0.0" | ||
}, | ||
"peerDependencies": { | ||
"@asciidoctor/core": "^2.0.0-rc.3" | ||
"@asciidoctor/core": "^2.0.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
143
44305