fix: image fallback regression (#1989)

* fix: image fallback regression

* fix image preview on upload

* fix image loading
This commit is contained in:
Philip Okugbe
2026-03-04 11:51:43 +00:00
committed by GitHub
parent 37355452e1
commit bea1637519
6 changed files with 34 additions and 11 deletions
+3 -2
View File
@@ -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;