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
remark plugin to bridge or mutate to retext.
This plugin is ready for the new parser in remark
(remarkjs/remark#536
).
No change is needed: it works exactly the same now as it did previously!
This package is ESM only:
Node 12+ is needed to use it and it must be import
ed instead of require
d.
npm:
npm install remark-retext
Say we have the following file, example.md
:
## Hello guys!
And our script, example.js
, looks as follows:
import {readSync} from 'to-vfile'
import {reporter} from 'vfile-reporter'
import {unified} from 'unified'
import remarkParse from 'remark-parse'
import remarkStringify from 'remark-stringify'
import remarkRetext from 'remark-retext'
import retextEnglish from 'retext-english'
import retextEquality from 'retext-equality'
const file = readSync('example.md')
unified()
.use(remarkParse)
.use(remarkRetext, unified().use(retextEnglish).use(retextEquality))
.use(remarkStringify)
.process(file)
.then((file) => {
console.error(reporter(file))
})
Now, running node example
yields:
example.md
1:10-1:14 warning `guys` may be insensitive, use `people`, `persons`, `folks` instead gals-man retext-equality
⚠ 1 warning
This package exports no identifiers.
The default export is remarkRetext
.
unified().use(remarkRetext, destination[, options])
remark (mdast) plugin to bridge or mutate 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 plugins
(mutate mode).
options
Passed to mdast-util-to-nlcst
.
Use of remark-retext
does not involve rehype (hast)
or user content so there are no openings for cross-site scripting (XSS)
attacks.
rehype-retext
— Transform HTML (hast) to natural language (nlcst)remark-rehype
— Transform Markdown (mdast) to HTML (hast)rehype-remark
— Transform HTML (hast) to Markdown (mdast)mdast-util-to-nlcst
— Underlying algorithmSee contributing.md
in remarkjs/.github
for ways
to get started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
FAQs
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.