2.0.12 • Published 3 months ago

marked-custom-heading-id v2.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

marked-custom-heading-id

Specify a custom heading id in headings with the Markdown Extended Syntax # 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

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>
2.0.11

7 months ago

2.0.12

3 months ago

2.0.9

10 months ago

2.0.10

10 months ago

2.0.8

1 year ago

2.0.7

1 year ago

2.0.6

2 years ago

2.0.5

2 years ago

2.0.3

2 years ago

2.0.4

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

3 years ago

1.0.2

3 years ago

1.0.1

4 years ago

1.0.0

4 years ago