
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@clarle/metalsmith-prism
Advanced tools
Syntax highlighting for Metalsmith HTML templates using Prism.js (with line numbers)
Syntax highlighting for Metalsmith HTML templates using Prism.js
The main difference between this package and Availity/metalsmith-prism is the support for line numbers, without any browser-side JavaScript. It's a bit of a hack, so use at your own risk.
npm install @clarle/metalsmith-prism --save-dev
<code class="language-css">p { color: red }</code>
metalsmith-prism
plugin to metalsmithvar metalsmith = require('metalsmith');
var metalsmithPrism = require('@clarle/metalsmith-prism');
metalsmith(__dirname)
.use(metalsmithPrism())
.build();
var metalsmith = require('metalsmith');
var markdown = require('metalsmith-markdown');
var metalsmithPrism = require('@clarle/metalsmith-prism');
metalsmith(__dirname)
// Custom langPrefix option needed as markdown uses 'lang-' by default:
.use(markdown( { langPrefix: 'language-' } ))
.use(metalsmithPrism())
.build();
Supports all programming languages that have a corresponding Prism.js component file. Component files are found in the Prism.js components
directory.
JSON syntax highlighting is enhanced using the following syntax definition
Prism.languages.json = {
'keys': /".+"(?=:)/g,
'boolean': /\b(true|false)/g,
'punctuation': /({|}|:|\[|\]|,)/g,
'keyword': /\b(null)\b/g
}
<code class="language-json">
{
ping: "pong"
}
</code>
markup
Metalsmith(__dirname)
.use(metalsmithPrism({
decode: true
}))
Metalsmith(__dirname)
.use(metalsmithPrism({
json: {
'keys': /".+"(?=:)/g,
'boolean': /\b(true|false)/g,
'punctuation': /({|}|:|\[|\]|,)/g,
'keyword': /\b(null)\b/g
}
}))
line-numbers
to parent <pre>
tag if presentMetalsmith(__dirname)
.use(metalsmithPrism({
lineNumbers: true
}))
Robert McGuinness
Open source software components distributed or made available in the Availity Materials are licensed to Company under the terms of the applicable open source license agreements, which may be found in text files included in the Availity Materials.
Code and documentation copyright 2016 Availity, LLC. Code released under the MIT license.
FAQs
Syntax highlighting for Metalsmith HTML templates using Prism.js (with line numbers)
We found that @clarle/metalsmith-prism demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.