# marked-custom-heading-id

> marked extension template

Latest version **2.0.17** (published 2026-04-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install marked-custom-heading-id
pnpm add marked-custom-heading-id
yarn add marked-custom-heading-id
bun add marked-custom-heading-id
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.17 |
| Published | 2026-04-07 |
| First published | 2021-05-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 10 |
| Author | Tony Brix |
| Maintainers | tonybrix |
| Keywords | marked, extension, custom, heading, id |

## Links

- npm: https://www.npmjs.com/package/marked-custom-heading-id
- Repository: https://github.com/markedjs/marked-custom-heading-id
- Homepage: https://github.com/markedjs/marked-custom-heading-id#readme
- Issues: https://github.com/markedjs/marked-custom-heading-id/issues
- npm.io page: https://npm.io/package/marked-custom-heading-id

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.0.17 (latest) — 2026-04-07
- 2.0.16 — 2025-11-07
- 2.0.15 — 2025-06-27
- 2.0.14 — 2025-03-26
- 2.0.13 — 2025-03-22
- 2.0.12 — 2025-03-12
- 2.0.11 — 2024-11-09
- 2.0.10 — 2024-08-24
- 2.0.9 — 2024-08-07
- 2.0.8 — 2024-06-12
- 2.0.7 — 2024-02-06
- 2.0.6 — 2023-11-30
- 2.0.5 — 2023-11-11
- 2.0.4 — 2023-09-11
- 2.0.3 — 2023-09-04
- … 6 more at https://npm.io/package/marked-custom-heading-id/versions

## README

# marked-custom-heading-id

Specify a custom heading id in headings with the [Markdown Extended Syntax](https://www.markdownguide.org/extended-syntax/#heading-ids) `# heading {#custom-id}`

The heading will be rendered with the string between `{#` and `}`

The id must be a valid id with the following criteria:

  - Must start with a letter (`A-Z`, `a-z`)
  - Must only contain word characters (`A-Z`, `a-z`, `0-9`, `_`) or dashes (`-`)

# Usage

```js
import { marked } from "marked";
import customHeadingId from "marked-custom-heading-id";

// or UMD script
// <script src="https://cdn.jsdelivr.net/npm/marked/lib/marked.umd.js"></script>
// <script src="https://cdn.jsdelivr.net/npm/marked-custom-heading-id/lib/index.umd.js"></script>

marked.use(customHeadingId());

marked("# heading {#custom-id}");
// <h1 id="custom-id">heading</h1>
```

---
_Source: https://npm.io/package/marked-custom-heading-id · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
