diff --git a/app/src/interfaces/input-rich-text-md/edits.ts b/app/src/interfaces/input-rich-text-md/edits.ts index 4013311165..f35d7c80b8 100644 --- a/app/src/interfaces/input-rich-text-md/edits.ts +++ b/app/src/interfaces/input-rich-text-md/edits.ts @@ -26,8 +26,8 @@ type AlterationFunctions = Record< export type CustomSyntax = { name: string; icon: string; - prefix: string; - suffix: string; + prefix: string | null; + suffix: string | null; box: 'inline' | 'block'; }; @@ -228,6 +228,9 @@ const alterations: AlterationFunctions = { custom(selection, { cursorTo, cursorHead }, options) { if (!options) return { newSelection: selection, newCursor: cursorHead }; + if (!options.prefix) options.prefix = ''; + if (!options.suffix) options.suffix = ''; + if (options.box === 'block') { // Multiline let newSelection = selection;