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

micromark-util-sanitize-uri

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micromark-util-sanitize-uri

micromark utility to sanitize urls

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.4M
increased by12.24%
Maintainers
1
Weekly downloads
 
Created

What is micromark-util-sanitize-uri?

The micromark-util-sanitize-uri npm package is designed to sanitize URLs within markdown content. It ensures that the URLs are safe to use by escaping or removing potentially harmful elements. This is particularly useful in preventing XSS (Cross-Site Scripting) attacks and other vulnerabilities that can arise from malicious URLs.

What are micromark-util-sanitize-uri's main functionalities?

Sanitize URLs

This feature allows you to sanitize URLs to ensure they are safe to use. It converts potentially dangerous URLs (like those starting with 'javascript:') into harmless ones (e.g., 'about:blank'), while leaving safe URLs unchanged.

"use strict";
var sanitize = require('micromark-util-sanitize-uri');

var safeUrl = sanitize('javascript:alert(document.cookie)');
console.log(safeUrl); // Logs: 'about:blank'

var safeUrl2 = sanitize('https://example.com');
console.log(safeUrl2); // Logs: 'https://example.com'

Other packages similar to micromark-util-sanitize-uri

Keywords

FAQs

Package last updated on 12 Nov 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