Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@centerforopenscience/markdown-it-imsize
Advanced tools
Markdown-it plugin to specify image size
A markdown-it plugin for size-specified image markups. This plugin overloads original image renderer of markdown-it.
var md = require('markdown-it')({
html: true,
linkify: true,
typography: true
}).use(require('markdown-it-imsize')); // <-- this use(package_name) is required
![test](image.png =100x200)
is interpreted as
<p><img src="image.png" alt="test" width="100" height="200"></p>
var md = require('markdown-it')({
html: true,
linkify: true,
typography: true
}).use(require('markdown-it-imsize'), { autofill: true });
will fill the width and height fields automatically if the specified image path is valid.
Therefore,
![test](image.png)
is interpreted as
<p><img src="image.png" alt="test" width="200" height="200"></p>
where image.png
is a valid path and its size is 200 x 200.
markdown-it-imsize
is available with bower and RequireJS. First, you can install the package with,
bower install markdown-it-imsize
Script for using markdown-it-imsize
with RequireJS is like,
require(['require', 'MarkdownIt', 'MarkdownItImsize'], function(require) {
var md = require('MarkdownIt')({
html: true,
linkify: true,
typography: true
}).use(require('MarkdownItImsize'));
var rendered = md.render("![test](test.jpg =100x)");
document.getElementById('image-box').innerHTML = rendered;
});
FAQs
Markdown-it plugin to specify image size
We found that @centerforopenscience/markdown-it-imsize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.