Closed TheMikeyRoss closed 3 weeks ago
I was scratching my head with this a little as well, but turns out things are actually being parsed correctly according to the GitHub flavoured Markdown spec. You just need to have a space in between the brackets as shown in the example.
@matthewlipski But I didn't manually type the brackets I literally just fetched them from my DB and parsed with tryParseMarkdownToBlocks
. To replicate my issue:
1- In blocknote, click the plus button to open the dropdown menu and select checklist
2- Start typing and you'll see an actual checkbox in every line your write (not brackets, but actual interactive checkboxes)
3- Save the content you wrote in a database using graphql or whatever, or maybe even a react state temporarily
4- Parse that content you saved using tryParseMarkdownToBlocks
and it will look like the screenshot above
I didn't add or remove any spaces between any brackets.
I just checked directly in my mongoDB and it has a space between the brackets:
but when parsed in the client ui:
I consoled logged the notes (before parsing it) and it looks fine with a space between the brackets:
So I'm fairly confident the tryParseMarkdownToBlocks
is removing a space between the brackets or doing something else wrong
the console.log is showing that there's a space between the brackets, but the tryParseMarkdownToBlocks
isn't
@matthewlipski or maybe it's replaceBlocks
that's removing the space between brackets?
@matthewlipski Oops my bad, the problem is in replaceBlocks
and not tryParseMarkdownToBlocks
I console logged the parsed blocks and it's keeping the space between the brackets
So the problem is 100% coming from replaceBlocks
Nice find, thanks for diving into this!
Describe the bug I'm parsing a markdown to blocks and it works fine but it seems to be missing the checkboxes (see attached image
Misc