mirror of
https://github.com/directus/directus.git
synced 2026-01-23 04:58:00 -05:00
Don't render explicit null values in md custom blocks (#14539)
Fixes #14383
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user