asciidoctor-prism-extension
Advanced tools
Comparing version 2.0.6 to 2.0.7
21
index.js
@@ -25,4 +25,2 @@ 'use strict'; | ||
const hasLanguage = (block) => block.getAttribute('language'); | ||
const getDocumentLanguages = (document) => { | ||
@@ -34,9 +32,3 @@ return (document.getAttribute('prism-languages') || DEFAULT_LANGUAGES) | ||
const unescape = html => { | ||
return html.replace(/=>/gi, '=>') | ||
.replace(/</gi, '<') | ||
.replace(/>/gi, '>'); | ||
}; | ||
module.exports = { | ||
const PrismExtension = { | ||
initialize (name, backend, {document}) { | ||
@@ -83,4 +75,4 @@ const languages = getDocumentLanguages(document); | ||
docinfo () { | ||
if (this.backend !== 'html5') { | ||
docinfo (location, doc) { | ||
if (!doc.isBasebackend('html')) { | ||
return ''; | ||
@@ -103,4 +95,7 @@ } | ||
module.exports.register = (Extensions) => { | ||
console.log(Object.keys(Extensions.$$)) | ||
module.exports = PrismExtension | ||
module.exports.register = function register (registry) { | ||
const AsciidoctorModule = registry.$$base_module | ||
const SyntaxHighlighterRegistry = AsciidoctorModule.$$['SyntaxHighlighter'] | ||
SyntaxHighlighterRegistry.register('prism', PrismExtension) | ||
} |
{ | ||
"name": "asciidoctor-prism-extension", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"description": "Highlight Asciidoc code listings with Prism.js, server side, with no front-end dependencies.", | ||
@@ -11,3 +11,3 @@ "main": "index.js", | ||
"type": "git", | ||
"url": "git+https://github.com/oncletom/asciidoctor-prism-extension.git" | ||
"url": "git+https://github.com/thom4parisot/asciidoctor-prism-extension.git" | ||
}, | ||
@@ -28,13 +28,13 @@ "engines": { | ||
], | ||
"author": "Thomas Parisot (https://oncletom.io)", | ||
"author": "Thomas Parisot (https://thom4.net)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/oncletom/asciidoctor-prism-extension/issues" | ||
"url": "https://github.com/thom4parisot/asciidoctor-prism-extension/issues" | ||
}, | ||
"homepage": "https://github.com/oncletom/asciidoctor-prism-extension#readme", | ||
"homepage": "https://github.com/thom4parisot/asciidoctor-prism-extension#readme", | ||
"dependencies": { | ||
"prismjs": "^1.15.0" | ||
"prismjs": "^1.27.0" | ||
}, | ||
"devDependencies": { | ||
"@asciidoctor/core": "^2.0.0" | ||
"@asciidoctor/core": "^2.2.6" | ||
}, | ||
@@ -41,0 +41,0 @@ "peerDependencies": { |
@@ -1,2 +0,2 @@ | ||
# asciidoctor-prism-extension [![Build Status](https://travis-ci.org/oncletom/asciidoctor-prism-extension.svg?branch=master)](https://travis-ci.org/oncletom/asciidoctor-prism-extension) | ||
# asciidoctor-prism-extension [![.github/workflows/test.yml](https://github.com/thom4parisot/asciidoctor-prism-extension/actions/workflows/test.yml/badge.svg)](https://github.com/thom4parisot/asciidoctor-prism-extension/actions/workflows/test.yml) | ||
@@ -3,0 +3,0 @@ > Highlight Asciidoc code listings with Prism.js, server side, with no front-end dependencies. |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
44645
8
143
1
Updatedprismjs@^1.27.0