summaryrefslogtreecommitdiff
path: root/packages/markdown
diff options
context:
space:
mode:
Diffstat (limited to 'packages/markdown')
-rw-r--r--packages/markdown/remark/src/remark-collect-images.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/markdown/remark/src/remark-collect-images.ts b/packages/markdown/remark/src/remark-collect-images.ts
index 0f1eb59f7..a9f524f7a 100644
--- a/packages/markdown/remark/src/remark-collect-images.ts
+++ b/packages/markdown/remark/src/remark-collect-images.ts
@@ -4,15 +4,15 @@ import type { MarkdownVFile } from './types';
export function remarkCollectImages() {
return function (tree: any, vfile: MarkdownVFile) {
- if (typeof vfile?.path !== 'string') return;
+ if (typeof vfile?.path !== 'string') return;
- const imagePaths = new Set<string>();
- visit(tree, 'image', (node: Image) => {
- if (shouldOptimizeImage(node.url)) imagePaths.add(node.url);
- });
+ const imagePaths = new Set<string>();
+ visit(tree, 'image', (node: Image) => {
+ if (shouldOptimizeImage(node.url)) imagePaths.add(node.url);
+ });
- vfile.data.imagePaths = imagePaths;
- };
+ vfile.data.imagePaths = imagePaths;
+ };
}
function shouldOptimizeImage(src: string) {