Don't render explicit null values in md custom blocks (#14539)

Fixes #14383
This commit is contained in:
Rijk van Zanten
2022-07-20 16:37:45 -04:00
committed by GitHub
parent 232e8e13d5
commit bccb4db791

View File

@@ -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;