Rosey / markdown-draft-js

A tool to convert content created in DraftJS to markdown and vice versa.
https://rosey.github.io/markdown-draft-js/
MIT License
317 stars 70 forks source link

Unable to handle combination of ordered and unordered list #173

Open AdarshPawar29 opened 2 years ago

AdarshPawar29 commented 2 years ago

The markdown I am writing in my editor:

1. Hello there!
 - hi
 - hi
2. Hello there!
 - hi

Markdown I get after converting markdownToDraft:

1. Hello there!
 - hi
 - hi
1. Hello there!
 - hi

rawObject:


  "entityMap": {},
  "blocks": [
    {
      "depth": 0,
      "type": "unstyled",
      "text": "`1. Hello there!",
      "entityRanges": [],
      "inlineStyleRanges": []
    },
    {
      "depth": 0,
      "type": "unordered-list-item",
      "text": "hi",
      "inlineStyleRanges": [],
      "entityRanges": []
    },
    {
      "depth": 0,
      "type": "unordered-list-item",
      "text": "hi",
      "inlineStyleRanges": [],
      "entityRanges": []
    },
    {
      "depth": 0,
      "type": "ordered-list-item",
      "text": "Hello there!",
      "inlineStyleRanges": [],
      "entityRanges": []
    },
    {
      "depth": 0,
      "type": "unordered-list-item",
      "text": "hi`",
      "inlineStyleRanges": [],
      "entityRanges": []
    }
  ]
}```