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.3 to 2.0.4

9

index.js

@@ -28,3 +28,3 @@ 'use strict';

const getDocumentLanguages = (document) => {
return document.getAttribute('prism-languages', DEFAULT_LANGUAGES)
return (document.getAttribute('prism-languages') || DEFAULT_LANGUAGES)
.split(',')

@@ -45,4 +45,5 @@ .map(lang => lang.trim());

loadLanguages(languages);
this.backend = backend;
this.theme = document.getAttribute('prism-theme');
this.theme = document.hasAttribute('prism-theme') ? document.getAttribute('prism-theme') || DEFAULT_THEME : null;
this.languages = languages;

@@ -84,5 +85,5 @@

const theme = this.theme || DEFAULT_THEME;
const {theme} = this;
if (!this.theme || !theme) {
if (!theme) {
return '';

@@ -89,0 +90,0 @@ }

{
"name": "asciidoctor-prism-extension",
"version": "2.0.3",
"version": "2.0.4",
"description": "Highlight Asciidoc code listings with Prism.js, server side, with no front-end dependencies.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -75,2 +75,11 @@ 'use strict';

assert.doesNotThrow(() => asciidoctor.convert(doc, options))
assert.doesNotThrow(() => asciidoctor.convert(doc, options));
// Default theme works
var attributes = [
'prism-theme',
'source-highlighter=prism',
];
var options = {attributes, backend, header_footer: true, safe: 'server'};
var output = asciidoctor.convert(doc, options);
assert.ok(output.match('<style type="text/css" class="prism-theme">'));
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