diff --git a/packages/excalidraw/element/embeddable.ts b/packages/excalidraw/element/embeddable.ts index 1dc1968a0..c68a2503c 100644 --- a/packages/excalidraw/element/embeddable.ts +++ b/packages/excalidraw/element/embeddable.ts @@ -52,6 +52,12 @@ const RE_REDDIT = const RE_REDDIT_EMBED = /^
{ @@ -268,6 +276,52 @@ export const getEmbedLink = ( return ret; } + const tutarLinkWithUserId = link.match(RE_TUTAR_WITH_USER_ID); + if(tutarLinkWithUserId) { + const [, apiKey, userId] = link.match(RE_TUTAR_WITH_USER_ID)!; + const safeURL = sanitizeHTMLAttribute( + `https://web.tutar.app?api-key=${apiKey}&user-id=${userId}`, + ); + const ret: IframeDataWithSandbox = { + type: "document", + srcdoc: () => + createSrcDoc(` + + `), + intrinsicSize: { w: 550, h: 550 }, + sandbox: { allowSameOrigin }, + }; + embeddedLinkCache.set(link, ret); + return ret; + } + + const tutarLinkWithoutUserId = link.match(RE_TUTAR_WITHOUT_USER_ID); + if(tutarLinkWithoutUserId) { + const [, apiKey] = link.match(RE_TUTAR_WITHOUT_USER_ID)!; + const safeURL = sanitizeHTMLAttribute( + `https://web.tutar.app?api-key=${apiKey}`, + ); + const ret: IframeDataWithSandbox = { + type: "document", + srcdoc: () => + createSrcDoc(` + + `), + intrinsicSize: { w: 550, h: 550 }, + sandbox: { allowSameOrigin }, + }; + embeddedLinkCache.set(link, ret); + return ret; + } + embeddedLinkCache.set(link, { link, intrinsicSize: aspectRatio,