About this project
remark is a markdown processor built around plugins, part of the unified collective. Rather than treating markdown as plain text, it parses it into a structured abstract syntax tree (mdast), which plugins can inspect and modify before the content is serialized again.
The monorepo contains several packages: remark-parse (markdown to syntax tree), remark-stringify (syntax tree back to markdown), remark (combining unified, parse and stringify for markdown-to-markdown work), and remark-cli (a command-line interface for inspecting and formatting markdown files).
Key characteristics described in the README:
- CommonMark compliant by default, with GFM or MDX support available through plugins.
- AST-based processing makes programmatic inspection and transformation straightforward.
- An ecosystem of 150+ plugins, including remark-gfm (GitHub flavored markdown), remark-lint (style checking), remark-toc (table of contents generation) and remark-rehype (markdown to HTML).
- Usable on servers, clients, CLIs and Deno.
Typical uses include converting markdown to HTML (often combined with the rehype ecosystem and rehype-sanitize), enabling syntax extensions such as GFM and YAML frontmatter, linting markdown for consistency, and formatting markdown files in a project via the CLI and a remarkConfig entry in package.json.
The project is fully typed with TypeScript, with mdast types available via @types/mdast. The README notes security considerations: because markdown can become HTML, improper handling can expose users to cross-site scripting, so rehype-sanitize is recommended when producing HTML; large or adversarial inputs can also cause performance or crash issues, so capping input size and processing in a separate thread or worker is advised. Plugins should be assessed individually for risk.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.