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

metalsmith-hover

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metalsmith-hover - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

15

lib/index.js

@@ -35,9 +35,11 @@

Object.keys(files).forEach(function(file) {
var page = cheerio.load(files[file].contents);
var links = page('a');
for (var i = 0; i < links.length; i++) {
if (image(links[i].attribs.href)) page(links[i]).append(img(links[i].attribs.href));
if (!~file.indexOf('.html')) return;
var $ = cheerio.load(files[file].contents);
var links = $('a');
for (var i = links.length - 1; i >= 0; i--) {
var url = links[i].attribs.href;
if (image(url)) $(links[i]).append(img(url));
}
page.root().prepend(css());
files[file].contents = new Buffer(page.html());
$.root().prepend(css());
files[file].contents = new Buffer($.html());
});

@@ -53,2 +55,3 @@ done();

function image(filename) {
if (!filename) return;
var ext = filename.split('.')[filename.split('.').length - 1];

@@ -55,0 +58,0 @@ return ~extensions.join().indexOf(ext);

2

package.json
{
"name": "metalsmith-hover",
"version": "0.0.1",
"version": "0.1.0",
"description": "A Metalsmith plugin to load links to images and gifs on hover.",

@@ -5,0 +5,0 @@ "keywords": [

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