Mark External Links
Add target and rel attributes to external links.
Automatically detects new links added to the document by installing a mutation observer. This makes it safe to use when adding content via AJAX, using frontend frameworks, etc.
Before
link
After
link
Installation
npm install mark-external-links
Usage
Import and call markExternalLinks()
.
Options
All options and their defaults:
In the browser
If you don't have the luxury of using a bundler, slap it in a script tag and call it a day.