Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

exmarkdown-heading-anchor

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exmarkdown-heading-anchor

⚓️ A svelte-exmarkdown plugin that places anchors in heading tags

  • 1.3.18
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
76
increased by1166.67%
Maintainers
1
Weekly downloads
 
Created
Source

exmarkdown-heading-anchor

npm-version npm-license npm-download-month npm-min-size ci.yml website

⚓️ A svelte-exmarkdown plugin that places anchors in heading tags

Demo

This is plugin of svelte-exmarkdown.
By using this plugin, convert Markdown as follows

Markdown

# Heading1

## Heading2

### Heading3

HTML

<h1 id="Heading1">Heading1</h1>
<h2 id="Heading2">Heading2</h2>
<h3 id="Heading3">Heading3</h2>

This supports navigation by anchor links.

<a href="/path/to/page#Heading3">To Heading3</a>

Installation

npm i exmarkdown-heading-anchor

Example

<script>
  import { headingAnchor } from 'exmarkdown-heading-anchor'
  import { Markdown } from 'svelte-exmarkdown'
</script>

<Markdown
  plugins={[
    // ...
    headingAnchor({
      /**
       * Character to prepend to ID to avoid collision
       * @default ''
       */
      prefix?: string,

      /**
       * Tag to add ID attribute
       * @default ['h1', 'h2', 'h3']
       */
      include?: ('h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6')[],

      /**
      * Specify a string to be added as an anchor link after the heading.
      * If not specified, no anchor link will be added.
      * @example 🔗
      * @default undefined
      */
      anchor?: string
    })
  ]}
/>

Full Plugin Options

License

MIT

Keywords

FAQs

Package last updated on 10 Apr 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc