asciidoctor-prism-extension
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -55,3 +55,3 @@ 'use strict'; | ||
if (Prism.languages[lang] === undefined) { | ||
if (typeof lang === 'string' && Prism.languages[lang] === undefined) { | ||
const {languages} = this; | ||
@@ -66,4 +66,4 @@ const source = node.lines.join('\n'); | ||
highlight (node, content, lang) { | ||
return Prism.highlight(content, Prism.languages[lang]) | ||
.replace(/____(\d+)____/gi, '<b class="conum">($1)</b>'); | ||
return typeof lang === 'string' ? Prism.highlight(content, Prism.languages[lang]) | ||
.replace(/____(\d+)____/gi, '<b class="conum">($1)</b>') : content; | ||
}, | ||
@@ -70,0 +70,0 @@ |
{ | ||
"name": "asciidoctor-prism-extension", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Highlight Asciidoc code listings with Prism.js, server side, with no front-end dependencies.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
11
test.js
@@ -56,2 +56,3 @@ 'use strict'; | ||
'prism-theme!', | ||
'source-highlighter=prism', | ||
]; | ||
@@ -66,11 +67,11 @@ var options = {attributes, backend, header_footer: true, safe: 'server'}; | ||
:source-highlighter: prism | ||
:prism-languages: bash | ||
[source] | ||
.options/zones.txt | ||
---- | ||
$ MYSQL_URL=mysql://user:password@server/database \ | ||
node sql-connect.js | ||
Europe/London | ||
America/New_York | ||
---- | ||
`; | ||
var output = asciidoctor.convert(doc, options); | ||
assert.ok(output); | ||
assert.doesNotThrow(() => asciidoctor.convert(doc, options)) |
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
44020
132