mdsvex-relative-images
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4323
65