plate icon indicating copy to clipboard operation
plate copied to clipboard

Serialize Markdown doesn't work with lists

Open lawandothman opened this issue 2 years ago • 1 comments

Description

Ordered / Unordered lists do not get serialized to markdown using serializeMd from @udecode/plate-serializer-md

This is how I'm using the plugin with my plate instance

<Plate
  initialValue={initialValue}
  onChange={(e) => {
    const editor = editorRef.current;
    
    if (!editor) {
      return;
    }
    console.log(serializeMd(editor, { nodes: e  }))
  }}
  editorRef={editorRef}
  plugins={plugins}
  >
  <FixedToolbar>
    <FixedToolbarButtons />
  </FixedToolbar>
  <Editor className='min-h-[300px] p-[20px]' />
</Plate>

Plate version

34

Slate React version

0.105.0

Screenshots

No response

Logs

No response

Browsers

No response

lawandothman avatar Jun 24 '24 17:06 lawandothman

Ah I just realised that I was using the plugin wrong. I managed to fix it by passing editor.nodes instead of the event :)

lawandothman avatar Jun 24 '24 19:06 lawandothman