Skip to content

editor.markdownToBlocks parse incorrectly #226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Adonis0123 opened this issue Jun 1, 2023 · 1 comment
Closed

editor.markdownToBlocks parse incorrectly #226

Adonis0123 opened this issue Jun 1, 2023 · 1 comment
Assignees
Labels
bug Something isn't working prio:mid Medium priority

Comments

@Adonis0123
Copy link

Adonis0123 commented Jun 1, 2023

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?

@matthewlipski matthewlipski added the prio:mid Medium priority label Jul 7, 2023
@matthewlipski matthewlipski added the bug Something isn't working label Sep 27, 2023
@thantos
Copy link

thantos commented Oct 5, 2023

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
Labels
bug Something isn't working prio:mid Medium priority
Projects
None yet
Development

No branches or pull requests

3 participants