Socket
Socket
Sign inDemoInstall

markdown-it-external-anchor

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    markdown-it-external-anchor

Mark external, absolute links with necessary attributes


Version published
Weekly downloads
116
increased by96.61%
Maintainers
1
Install size
5.19 kB
Created
Weekly downloads
 

Readme

Source

MarkdownIt External Anchor

npm bundle size CI Test

Mark external, absolute links with appropriate rel & target attributes

  • Prevents XSS attacks & provides good UX
  • Does not affect HTML within markdown

Note: If you want anything, just open an issue or contact me.

Install

$ npm install --save markdown-it markdown-it-external-anchor

Usage

const md = require("markdown-it")();
md.use(require("markdown-it-external-anchor"), {
    domain: "example.net",
    class: "external"
});

md.render("[text](https://example.com)");

Options

  • domain (default: null) - A domain which is considered an internal link. (no "https://"). When provided, localhost is also added.
  • class (default: null) - a class name, for CSS purposes

License

MIT © Binyamin Green

Keywords

FAQs

Last updated on 24 Nov 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc