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

mdsvex-relative-images

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdsvex-relative-images - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

9

index.js

@@ -46,8 +46,7 @@ // credit to pngwn doing majority of the plugin - https://github.com/pngwn/MDsveX/discussions/246#discussioncomment-720947

visit(tree, "html", (node) => {
const elements = ["img", "video"];
// only run on img or video elements. this is a cheap way to check it,
// eventually we should integrate it into the RE_SRC regex.
const isSupportedElement = node.value && node.value.match(/img|video/);
if (
node.value &&
elements.some((el) => node.value.startsWith(`<${el}`))
) {
if (isSupportedElement) {
const [, url] = node.value.match(RE_SRC) ?? [];

@@ -54,0 +53,0 @@ if (url) {

{
"name": "mdsvex-relative-images",
"version": "0.0.2",
"version": "0.0.3",
"description": "Add support for relative image URLs in mdsvex",

@@ -5,0 +5,0 @@ "main": "index.js",

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