
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@fpapado/eleventy-plugin-syntaxhighlight
Advanced tools
A pack of Eleventy plugins for syntax highlighting for Markdown and Liquid templates.
A pack of Eleventy plugins for syntax highlighting. No browser/client JavaScript here, these highlight transformations are all done at build-time.
Available on npm.
npm install @11ty/eleventy-plugin-syntaxhighlight --save
Open up your Eleventy config file (probably .eleventy.js) and use addPlugin:
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(syntaxHighlight);
};
You are responsible for including your favorite PrismJS theme CSS!
Read more about Eleventy plugins.
Optionally pass in an options object as the second argument to addPlugin to further customize this plugin pack.
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(syntaxHighlight, {
// Change which syntax highlighters are installed
templateFormats: ["*"], // default
// Or, just njk and md syntax highlighters (do not install liquid)
// templateFormats: ["njk", "md"],
// init callback lets you customize Prism
init: function({ Prism }) {
Prism.languages.myCustomLanguage = /* */;
}
});
};
{% highlight %}: syntax highlights using PrismJS.{% highlight %}: syntax highlights using PrismJS.Optionally specify a language after the start of the markdown fenced code block.
<!-- Markdown Template -->
``` js
function myFunction() {
return true;
}
```
<!--
Line highlighting classes (single highlight)
Adds `highlight-line-active` class to lines 1,3,4,5 (for line highlighting)
-->
<!-- Markdown Template -->
``` js/1,3-5
function myFunction() {
// …
return true;
}
```
<!--
Line highlighting classes (add and remove mode)
Adds `highlight-line-add` class to lines 1,3
Adds `highlight-line-remove` class to lines 5,6,7,8
-->
<!-- Markdown Template -->
``` js/1,3/5-8
function myFunction() {
// …
return true;
}
```
Use text to use the line highlighting features without PrismJS.
``` text/1-2
function myFunction() {
let highlighted = true;
return highlighted;
}
```
<!-- Liquid Template -->
{% highlight js %}
function myFunction() {
return true;
}
{% endhighlight %}
<!--
Line highlighting classes (single highlight)
Adds `highlight-line-active` class to lines 1,3,4,5 (for line highlighting)
-->
<!-- Liquid Template -->
{% highlight js 1,3-5 %}
function myFunction() {
// …
return true;
}
{% endhighlight %}
<!--
Line highlighting classes (add and remove)
Adds `highlight-line-add` class to lines 1,3
Adds `highlight-line-remove` class to lines 5,6,7,8
-->
<!-- Liquid Template -->
{% highlight js 1,3 5-8 %}
function myFunction() {
// …
return true;
}
{% endhighlight %}
Use text to use the line highlighting features without PrismJS.
<!-- Liquid Template -->
{% highlight text 1-2 %}
function myFunction() {
let highlighted = true;
return highlighted;
}
{% endhighlight %}
<!-- Nunjucks Template -->
{% highlight "js" %}
function myFunction() {
return true;
}
{% endhighlight %}
<!--
Line highlighting classes (single highlight)
Adds `highlight-line-active` class to lines 1,3,4,5 (for line highlighting)
-->
<!-- Nunjucks Template -->
{% highlight "js 1,3-5" %}
function myFunction() {
// …
return true;
}
{% endhighlight %}
<!--
Line highlighting classes (add and remove)
Adds `highlight-line-add` class to lines 1,3
Adds `highlight-line-remove` class to lines 5,6,7,8
-->
<!-- Nunjucks Template -->
{% highlight "js 1,3 5-8" %}
function myFunction() {
// …
return true;
}
{% endhighlight %}
Use text to use the line highlighting features without PrismJS.
<!-- Nunjucks Template -->
{% highlight "text 1-2" %}
function myFunction() {
let highlighted = true;
return highlighted;
}
{% endhighlight %}
.highlight-line {
display: inline-block;
/* del, ins, mark default styles */
text-decoration: none;
color: inherit;
}
/* allow highlighting empty lines */
.highlight-line:empty:before {
content: " ";
}
.highlight-line:not(:last-child) {
min-width: 100%;
}
.highlight-line .highlight-line:not(:last-child) {
min-width: 0;
}
/*
* Dark theme
*/
.highlight-line-isdir {
color: #b0b0b0;
background-color: #222;
}
.highlight-line-active {
background-color: #444;
background-color: hsla(0, 0%, 27%, .8);
}
.highlight-line-add {
background-color: #45844b;
}
.highlight-line-remove {
background-color: #902f2f;
}
FAQs
A pack of Eleventy plugins for syntax highlighting for Markdown and Liquid templates.
The npm package @fpapado/eleventy-plugin-syntaxhighlight receives a total of 0 weekly downloads. As such, @fpapado/eleventy-plugin-syntaxhighlight popularity was classified as not popular.
We found that @fpapado/eleventy-plugin-syntaxhighlight 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.