Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
remark-retext
Advanced tools
Bridge / mutate from remark to retext.
npm:
npm install remark-retext
Say we have the following file, example.md
:
## Hello guys!
And our script, example.js
, looks as follows:
var vfile = require('to-vfile');
var report = require('vfile-reporter');
var unified = require('unified');
var parse = require('remark-parse');
var stringify = require('remark-stringify');
var remark2retext = require('remark-retext');
var english = require('retext-english');
var equality = require('retext-equality');
unified()
.use(parse)
.use(remark2retext, unified().use(english).use(equality))
.use(stringify)
.process(vfile.readSync('example.md'), function (err, file) {
console.error(report(err || file));
});
Now, running node example
yields:
example.md
1:10-1:14 warning `guys` may be insensitive, use `people`, `persons`, `folks` instead gals-men retext-equality
⚠ 1 warning
origin.use(remark2retext, destination[, options])
Either bridge or mutate from remark (MDAST) to retext (NLCST).
destination
destination
is either a parser or a processor.
If a Unified
processor is given, runs the destination
processor with the new NLCST tree, then, after running discards that
tree and continues on running the origin processor with the original
tree (bridge-mode).
If a parser (such as parse-latin, parse-english, or parse-dutch) is given, passes the tree to further plug-ins (mutate-mode).
options
Passed to mdast-util-to-nlcst
.
rehype-retext
— Transform HTML to NLCSTremark-rehype
— Transform markdown to HTMLrehype-remark
— Transform HTML to markdownmdast-util-to-nlcst
— Underlying algorithmFAQs
remark plugin to support retext
We found that remark-retext demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.