
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
remarkable-header-ids
Advanced tools
Remarkable plugin to auto generate unique header ids, highly customizable
Autogenerate unique ids for text headers (h1,...h6)
Install with npm:
$ npm install --save remarkable-header-ids
const HeaderIdsPlugin = require("remarkable-header-ids");
const Remarkable = require("remarkable");
const markdownParser = new Remarkable().use(
HeaderIdsPlugin()
);
Params
| Option name | Type | defaultValue | Note |
|---|---|---|---|
| levels | number[] | [1, 2, 3, 4, 5, 6] | |
| anchorClassName | string | "header-anchor" | |
| anchorText | string | "#" | When anchorText is empty, the anchor will not be rendered at all |
| headerId | (slug: string) => string | slug => "heading-#" + slug |
Example
const Remarkable = require("remarkable");
const HeaderIdsPlugin = require("remarkable-header-ids");
const parser = new Remarkable().use(
HeaderIdsPlugin({
levels: [2], // only transform h2
anchorClassName: "this-is-anchor-in-header",
anchorText: "AnchorText",
headerId: (slug) =>
`header-that-has-this-anchor-${slug}`,
})
);
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guide for avice on opening issues, pull requests, and coding standards.
Test content is located inside the test directory. For more info regarding the internals of test suite, check out test/parse.js.
to run the test, execute npm test from the root directory. This script will render into test/parsed.html.
Farzad Yousefzadeh
Copyright © 2020, github/farskid. Released under the MIT license.
FAQs
Remarkable plugin to auto generate unique header ids, highly customizable
The npm package remarkable-header-ids receives a total of 154 weekly downloads. As such, remarkable-header-ids popularity was classified as not popular.
We found that remarkable-header-ids demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.