@anthonypena/marked-heading-links
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

@anthonypena/marked-heading-links

Install

npm i @anthonypena/marked-heading-links

Examples

Add the plugin to your Marked instance

import { markedHeadingLinks } from '@anthonypena/marked-heading-links';
import { Marked } from 'marked';

const marked = new Marked();

marked.use(markedHeadingLinks());

Transformation

From:

## Foo

to:

<h2 id="foo">Foo<a href="#foo" class="anchor" aria-label="permalink">🔗</a></h2>

Docs

Parameters

prefix (optional): id prefix

Default: ''

linkClass (optional): class to add to link

Default: 'anchor'

linkLabel (optional): label of the link

Default: '🔗'

marked (optional): a Marked instance

Default: new Marked instance

Readme

Keywords

Package Sidebar

Install

npm i @anthonypena/marked-heading-links

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

10.6 kB

Total Files

15

Last publish

Collaborators

  • kuroidoruido