mdsvex-relative-images
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -46,3 +46,8 @@ // credit to pngwn doing majority of the plugin - https://github.com/pngwn/MDsveX/discussions/246#discussioncomment-720947 | ||
visit(tree, "html", (node) => { | ||
if (node.value) { | ||
const elements = ["img", "video"]; | ||
if ( | ||
node.value && | ||
elements.some((el) => node.value.startsWith(`<${el}`)) | ||
) { | ||
const [, url] = node.value.match(RE_SRC) ?? []; | ||
@@ -49,0 +54,0 @@ if (url) { |
{ | ||
"name": "mdsvex-relative-images", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Add support for relative image URLs in mdsvex", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -28,1 +28,8 @@ # mdsvex-relative-images | ||
``` | ||
It also works for img and video tags: | ||
```svelte | ||
<img src="./my-image.png" /> | ||
<video src="./my-video.mp4" /> | ||
``` |
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
4217
66
35