marky-deep-links

1.0.1 • Public • Published

marky-deep-links

npm travis

Make heading links work in marky-markdown generated HTML

Inspired by: npm/newww deep-links.js

In marky-markdown generated heading DOM ids are prefixed with user-content- for security reasons. This package checks whether someone has clicked on an auto-generated id, and updates the URL fragment remove the prefix, and scrolls the page to the header. This also works at startup if someone links to an anchor from an external site.

This package works best with browserify!

Install

npm install --save marky-deep-links

Usage

var markyDeepLinks = require('marky-deep-links')
 
markyDeepLinks()
 

Pre-built Files for Browsers

For convenience, feel free to use the browserify generated files included in this package:

  • marky-deep-links-standalone-min.js (minified)
  • marky-deep-links-standalone.js (unminified)

Note that these are set up to use the default user-content- prefix.

Contributing

Contributions welcome! Please read the contributing guidelines first.

License

ISC

Package Sidebar

Install

npm i marky-deep-links

Weekly Downloads

262

Version

1.0.1

License

ISC

Last publish

Collaborators

  • flet