
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
remark-slug
Advanced tools
Deprecated: this package is no longer maintained. Please use `remark-rehype` to move from remark (markdown) to rehype (HTML) and then replace `remark-slug` with [`rehype-slug`](https://github.com/rehypejs/rehype-slug).
The remark-slug npm package is a plugin for the remark Markdown processor that automatically adds slugs to headings in a Markdown document. This is useful for generating links to specific sections of the document, enhancing navigation and accessibility.
Automatic Slug Generation
This feature automatically generates slugs for each heading in a Markdown document. The code sample shows how to use remark-slug with remark and remark-html to convert a Markdown heading into HTML with a slug.
const remark = require('remark');
const remarkHtml = require('remark-html');
const remarkSlug = require('remark-slug');
remark()
.use(remarkSlug)
.use(remarkHtml)
.process('# Hello world', function (err, file) {
console.log(String(file));
});
markdown-it-anchor is a plugin for the markdown-it Markdown parser. Similar to remark-slug, it adds anchors to headings in Markdown documents. While remark-slug is specifically designed for the remark ecosystem, markdown-it-anchor serves the markdown-it ecosystem, offering similar functionality but within a different processing environment.
rehype-slug is a plugin for the rehype processor, which is part of the unified.js ecosystem, similar to remark. It adds slugs to HTML elements processed through rehype. This is akin to what remark-slug does but is applied directly to HTML rather than Markdown, making it suitable for projects that work with HTML content at a later stage in the content pipeline.
Deprecated: this package is no longer maintained.
Please use remark-rehype
to move from remark (markdown) to rehype (HTML)
and then replace remark-slug
with
rehype-slug
.
Git is still intact and previous versions can still be used without warnings.
FAQs
Deprecated: this package is no longer maintained. Please use `remark-rehype` to move from remark (markdown) to rehype (HTML) and then replace `remark-slug` with [`rehype-slug`](https://github.com/rehypejs/rehype-slug).
The npm package remark-slug receives a total of 1,998,349 weekly downloads. As such, remark-slug popularity was classified as popular.
We found that remark-slug demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.