File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
packages/markdown/src/lib/rules Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @platejs/markdown ' : patch
3+ ---
4+
5+ Fix custom headings node type.
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import { Button } from "@/components/ui/button";
1111import { BaseEditorKit } from "@/registry/components/editor/editor-base-kit" ;
1212import { ListKit } from "@/registry/components/editor/plugins/list-classic-kit" ;
1313import { MarkdownKit } from "@/registry/components/editor/plugins/markdown-kit" ;
14- import { listValue } from "@/registry/examples/values/list-classic -value" ;
14+ import { basicBlocksValue } from "@/registry/examples/values/basic-blocks -value" ;
1515import { Editor , EditorContainer } from "@/registry/ui/editor" ;
1616
1717
@@ -63,11 +63,11 @@ const withCustomPlugins = (plugins: any[]): any[] => {
6363let index = 0
6464
6565const value = normalizeNodeId ( [
66- // ...withCustomType(basicBlocksValue),
66+ ...withCustomType ( basicBlocksValue ) ,
6767 // ...withCustomType(basicMarksValue),
6868 // ...withCustomType(tableValue),
6969 // ...withCustomType(codeBlockValue),
70- ...withCustomType ( listValue ) ,
70+ // ...withCustomType(listValue),
7171 // ...listValue,
7272] , {
7373 idCreator ( ) {
Original file line number Diff line number Diff line change @@ -310,6 +310,7 @@ export const defaultRules: MdRules = {
310310 } ;
311311 } ,
312312 serialize : ( node , options ) => {
313+ const key = getPluginKey ( options . editor ! , node . type ) ;
313314 const depthMap = {
314315 h1 : 1 ,
315316 h2 : 2 ,
@@ -324,7 +325,7 @@ export const defaultRules: MdRules = {
324325 node . children ,
325326 options
326327 ) as MdHeading [ 'children' ] ,
327- depth : depthMap [ node . type as keyof typeof depthMap ] as any ,
328+ depth : depthMap [ key as keyof typeof depthMap ] as any ,
328329 type : 'heading' ,
329330 } ;
330331 } ,
You can’t perform that action at this time.
0 commit comments