🎉 initiate project *astro_rewrite*
This commit is contained in:
parent
ffd4d5e86c
commit
2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions
21
node_modules/@astrojs/markdown-remark/dist/rehype-images.js
generated
vendored
Normal file
21
node_modules/@astrojs/markdown-remark/dist/rehype-images.js
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { visit } from "unist-util-visit";
|
||||
function rehypeImages() {
|
||||
return () => function(tree, file) {
|
||||
visit(tree, (node) => {
|
||||
var _a, _b;
|
||||
if (node.type !== "element")
|
||||
return;
|
||||
if (node.tagName !== "img")
|
||||
return;
|
||||
if ((_a = node.properties) == null ? void 0 : _a.src) {
|
||||
if ((_b = file.data.imagePaths) == null ? void 0 : _b.has(node.properties.src)) {
|
||||
node.properties["__ASTRO_IMAGE_"] = node.properties.src;
|
||||
delete node.properties.src;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
export {
|
||||
rehypeImages
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue