diff --git a/frontend/apps/desktop/src/editor/blocknote/core/extensions/LinkMenu/defaultLinkMenuItems.tsx b/frontend/apps/desktop/src/editor/blocknote/core/extensions/LinkMenu/defaultLinkMenuItems.tsx index 0cbc80a4..7a0b4985 100644 --- a/frontend/apps/desktop/src/editor/blocknote/core/extensions/LinkMenu/defaultLinkMenuItems.tsx +++ b/frontend/apps/desktop/src/editor/blocknote/core/extensions/LinkMenu/defaultLinkMenuItems.tsx @@ -1,12 +1,12 @@ import {HMBlockSchema} from '@/editor/schema' import {youtubeParser} from '@/editor/utils' import { - StateStream, - UnpackedHypermediaId, createHMUrl, isHypermediaScheme, isPublicGatewayLink, normalizeHmId, + StateStream, + UnpackedHypermediaId, } from '@shm/shared' import { File as FileIcon, @@ -243,7 +243,7 @@ export function getLinkMenuItems({ const {state, schema} = editor._tiptapEditor const {selection} = state if (!selection.empty) return - let embedUrl = link ? link : sourceUrl ? sourceUrl : '' + let embedUrl = '' if (media === 'video') { let videoUrl = link ? link : sourceUrl ? sourceUrl : '' if (videoUrl.includes('youtu.be') || videoUrl.includes('youtube')) { @@ -261,11 +261,12 @@ export function getLinkMenuItems({ } embedUrl = videoUrl } + const node = media !== 'twitter' ? schema.nodes[media].create({ url: embedUrl ? embedUrl : '', - src: embedUrl ? '' : link, + src: embedUrl ? '' : link ? link : sourceUrl ? sourceUrl : '', name: fileName ? fileName : '', }) : schema.nodes['web-embed'].create({ diff --git a/frontend/apps/desktop/src/editor/image.tsx b/frontend/apps/desktop/src/editor/image.tsx index 73ec8be6..67f82169 100644 --- a/frontend/apps/desktop/src/editor/image.tsx +++ b/frontend/apps/desktop/src/editor/image.tsx @@ -20,6 +20,9 @@ export const ImageBlock = createReactBlockSpec({ url: { default: '', }, + src: { + default: '', + }, alt: { default: '', },