diff --git a/apps/builder/src/assets/styles/plate.css b/apps/builder/src/assets/styles/plate.css index 784a9a241..72845f86f 100644 --- a/apps/builder/src/assets/styles/plate.css +++ b/apps/builder/src/assets/styles/plate.css @@ -1,8 +1,9 @@ .slate-inline-code { - background-color: #805ad5; + background-color: #a1a1aa; color: white; padding: 0.125rem 0.25rem; border-radius: 0.35rem; + font-size: small; } .slate-variable { diff --git a/packages/bot-engine/parseBubbleBlock.ts b/packages/bot-engine/parseBubbleBlock.ts index 7eef39c81..207187b7e 100644 --- a/packages/bot-engine/parseBubbleBlock.ts +++ b/packages/bot-engine/parseBubbleBlock.ts @@ -209,6 +209,26 @@ const applyElementStyleToDescendants = ( }) const convertMarkdownToRichText = (text: string): TDescendant[] => { + const spacesBefore = text.match(/^[\s]+/) + const spacesAfter = text.match(/[\s]+$/) const plugins = [createDeserializeMdPlugin()] - return deserializeMd(createPlateEditor({ plugins }) as unknown as any, text) + return [ + ...(spacesBefore?.at(0) + ? [ + { + type: 'p', + text: spacesBefore.at(0), + }, + ] + : []), + ...deserializeMd(createPlateEditor({ plugins }) as unknown as any, text), + ...(spacesAfter?.at(0) + ? [ + { + type: 'p', + text: spacesAfter.at(0), + }, + ] + : []), + ] }