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.
@agrarium/plugin-markdown
Advanced tools
Agrarium plugin for markdown files resolving.
npm i agrarium
Or use it standalone:
npm i @agrarium/plugin-markdown
In your .agrarium.js
file:
const { PluginMarkdown } = require('agrarium');
module.exports = {
src: ['./src/components'],
plugins: [
new PluginMarkdown({/* options */})
]
}
It returns content of markdown files in JSON. More info about PostHTMLTree here.
console.log(chunk.data)
{
markdown: [{
lang: 'en',
content: [/* json */],
file: {
path: 'test/fixtures/blocks/test-block/test-block.md'
}
}, {
lang: 'en',
content: [/* json */],
file: {
path: 'test/fixtures/blocks/test-block/_mod/test-block_mod.md'
}
}]
}
Returns content in JSON.
Returns content in HTML string.
Adds prefix for parsed classes.
Sets what langs you support in markdown. For example you can have: button.md
and button.ru.md
.
You need to set this option in your .agrarium.js
file:
const { PluginMarkdown } = require('agrarium');
module.exports = {
src: ['./src/components'],
plugins: [
new PluginMarkdown({
i18n: {
langs: ['en', 'ru'],
default: 'en'
}
})
]
};
You can setup some hooks to modify markdown entites. It can be inline sources for example.
Parses inline sources in markdown and replace it with iframe
. Example:
const builder = require('./builder');
agrarium({
src: ['./src/components'],
plugins: [
new PluginMarkdown({
hooks: {
inlineSource({ lang, content } {
if (lang === 'js') {
builder(content);
return {
src: '/static/daweasc123da.html'
}
}
}
}
})
]
});
FAQs
Agrarium plugin for markdown files resolving
The npm package @agrarium/plugin-markdown receives a total of 0 weekly downloads. As such, @agrarium/plugin-markdown popularity was classified as not popular.
We found that @agrarium/plugin-markdown demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.