Skip to content

editor.markdownToBlocks parse incorrectly #226

Closed

Description

@Adonis0123
const markdown = `
- 📝 item1
- ⚙️ item2
- 🔗 item3

# h1
`
const blocks: Block[] = await editor.markdownToBlocks(markdown);
console.log(blocks, "blocks");

I get the blocks.length is 3 , it seems look like lost # h1

however, when the # h1 is in the top

const markdown = `
# h1
- 📝 item1
- ⚙️ item2
- 🔗 item3
`
const blocks: Block[] = await editor.markdownToBlocks(markdown);
console.log(blocks, "blocks");

I get the blocks.length is 4 , it can correctly parsed # h1 and list

codesandbox

Is this a bug?

Activity

  1. thantos commented on Oct 5, 2023

    @thantos

    Seeing this too. Any content after a numeric or bulleted list when the markdown starts with the list is lost on conversion.

    Start:

    * a
    * b
    * c

    Edit:

    * a
    * b
    * c
    * d
    
    anything
    
    [a link](to here)
    
    * another
    * list

    Reload:

    * a
    * b
    * c
    * d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions