Skip to content

Commit

Permalink
fix: add margin to editor's paragraph
Browse files Browse the repository at this point in the history
  • Loading branch information
olexh committed Jun 18, 2024
1 parent c1ce806 commit 89f2b35
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion components/markdown/plate-editor/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@ import {
createSoftBreakPlugin,
} from '@udecode/plate-break';
import {
PlateElement,
RenderAfterEditable,
createPlugins,
isSelectionAtBlockStart,
} from '@udecode/plate-common';
import { ELEMENT_LINK, createLinkPlugin } from '@udecode/plate-link';
import { createListPlugin } from '@udecode/plate-list';
import { createParagraphPlugin } from '@udecode/plate-paragraph';
import {
ELEMENT_PARAGRAPH,
createParagraphPlugin,
} from '@udecode/plate-paragraph';
import { createResetNodePlugin } from '@udecode/plate-reset-node';

import { withCn } from '@/utils/utils';

import ItalicLeaf from './plate-ui/italic-leaf';
import LinkElement from './plate-ui/link-element';
import { LinkFloatingToolbar } from './plate-ui/link-floating-toolbar';
Expand All @@ -29,6 +35,8 @@ import {
import StrongLeaf from './plate-ui/strong-leaf';
import { createDeserializeMdPlugin } from './serializer-md';

export const ParagraphElement = withCn(PlateElement, 'mb-4 p-0');

const plugins = createPlugins(
[
createDeserializeMdPlugin(),
Expand Down Expand Up @@ -84,6 +92,7 @@ const plugins = createPlugins(
[MARK_BOLD]: StrongLeaf,
[ELEMENT_LINK]: LinkElement,
[ELEMENT_SPOILER]: SpoilerElement,
[ELEMENT_PARAGRAPH]: ParagraphElement,
},
},
);
Expand Down

0 comments on commit 89f2b35

Please sign in to comment.