Skip to content

Commit

Permalink
chore: fix typing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldziher committed Dec 25, 2024
1 parent 6cd6231 commit ec5314e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/markdown/src/lib/MarkdownPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const MarkdownPlugin = createTSlatePlugin<MarkdownConfig>({
.extend(({ api }) => ({
parser: {
deserialize: ({ data }) => api.markdown.deserialize(data),
format: 'text/plain',
format: 'text/markdown',
query: ({ data, dataTransfer }) => {
const htmlData = dataTransfer.getData('text/html');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit ec5314e

Please sign in to comment.