From 4fd0e999098e768e36e3997d43c61f0ebe0fb7e4 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 26 Dec 2023 21:41:07 -0500 Subject: [PATCH] fix: Allow embedding editable Grist closes #6013 --- shared/editor/embeds/index.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/shared/editor/embeds/index.tsx b/shared/editor/embeds/index.tsx index f0d6fa401..141d66b73 100644 --- a/shared/editor/embeds/index.tsx +++ b/shared/editor/embeds/index.tsx @@ -357,8 +357,13 @@ const embeds: EmbedDescriptor[] = [ name: IntegrationService.Grist, keywords: "spreadsheet", regexMatch: [new RegExp("^https?://([a-z.-]+\\.)?getgrist\\.com/(.+)$")], - transformMatch: (matches: RegExpMatchArray) => - matches[0].replace(/(\?embed=true)?$/, "?embed=true"), + transformMatch: (matches: RegExpMatchArray) => { + if (matches[0].includes("style=singlePage")) { + return matches[0]; + } + + return matches[0].replace(/(\?embed=true)?$/, "?embed=true"); + }, icon: Grist, }), new EmbedDescriptor({