mirror of
https://github.com/docmost/docmost.git
synced 2026-06-16 06:57:01 +08:00
fix: image fallback regression (#1989)
* fix: image fallback regression * fix image preview on upload * fix image loading
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Node, mergeAttributes, ResizableNodeView } from "@tiptap/core";
|
||||
import type { ResizableNodeViewDirection } from "@tiptap/core";
|
||||
import { ReactNodeViewRenderer } from "@tiptap/react";
|
||||
import { normalizeFileUrl } from "./media-utils";
|
||||
|
||||
export type ExcalidrawResizeOptions = {
|
||||
enabled: boolean;
|
||||
@@ -223,7 +224,7 @@ export const Excalidraw = Node.create<ExcalidrawOptions>({
|
||||
}
|
||||
|
||||
const el = document.createElement("img");
|
||||
el.src = node.attrs.src;
|
||||
el.src = normalizeFileUrl(node.attrs.src);
|
||||
el.alt = node.attrs.title || "";
|
||||
el.style.display = "block";
|
||||
el.style.maxWidth = "100%";
|
||||
@@ -259,7 +260,7 @@ export const Excalidraw = Node.create<ExcalidrawOptions>({
|
||||
}
|
||||
|
||||
if (updatedNode.attrs.src !== currentNode.attrs.src) {
|
||||
el.src = updatedNode.attrs.src || "";
|
||||
el.src = normalizeFileUrl(updatedNode.attrs.src);
|
||||
}
|
||||
|
||||
const w = updatedNode.attrs.width;
|
||||
|
||||
Reference in New Issue
Block a user