Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

asciidoctor-prism-extension

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asciidoctor-prism-extension - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

6

index.js

@@ -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",

@@ -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))
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc