diff --git a/packages/markdown/src/lib/MarkdownPlugin.ts b/packages/markdown/src/lib/MarkdownPlugin.ts index 1e9ff29e44..872251154b 100644 --- a/packages/markdown/src/lib/MarkdownPlugin.ts +++ b/packages/markdown/src/lib/MarkdownPlugin.ts @@ -63,7 +63,7 @@ export const MarkdownPlugin = createTSlatePlugin({ .extend(({ api }) => ({ parser: { deserialize: ({ data }) => api.markdown.deserialize(data), - format: 'text/plain', + format: 'text/markdown', query: ({ data, dataTransfer }) => { const htmlData = dataTransfer.getData('text/html'); diff --git a/packages/markdown/src/lib/remark-slate/remarkDefaultElementRules.ts b/packages/markdown/src/lib/remark-slate/remarkDefaultElementRules.ts index 398797e106..f8a43d757a 100644 --- a/packages/markdown/src/lib/remark-slate/remarkDefaultElementRules.ts +++ b/packages/markdown/src/lib/remark-slate/remarkDefaultElementRules.ts @@ -50,15 +50,7 @@ export const remarkDefaultElementRules: RemarkElementRules = { 6: 'h6', }[depth]; - const type = options.editor.getType({ key: headingType }); - - if (!type) { - - return { - children: remarkTransformElementChildren(node, options), - type: options.editor.getType({ key: 'p' }), - }; - } + const type = options.editor.getType({ key: headingType ?? 'h3' }); return { children: remarkTransformElementChildren(node, options),