mirror of
https://github.com/outline/outline.git
synced 2026-12-01 17:32:49 +03:00
docs
This commit is contained in:
1 parent
e4e8603bc2
commit
515f050bee
1 file changed
+3
-1
@@ -99,7 +99,7 @@ export class UploadPlugin extends Plugin {
|
||||
},
|
||||
},
|
||||
transformPasted: (slice, view) => {
|
||||
// find images in slice
|
||||
// find any remote images in pasted slice, but leave it alone.
|
||||
const images: Node[] = [];
|
||||
slice.content.descendants((node) => {
|
||||
if (node.type.name === "image" && !isInternalUrl(node.attrs.src)) {
|
||||
@@ -107,6 +107,8 @@ export class UploadPlugin extends Plugin {
|
||||
}
|
||||
});
|
||||
|
||||
// Upload each remote image to our storage and replace the src
|
||||
// with the new url and dimensions.
|
||||
void images.map(async (image) => {
|
||||
const url = await options.uploadFile?.(image.attrs.src);
|
||||
|
||||
|
||||
Reference in new issue
Block a user