Giter Site home page Giter Site logo

Comments (7)

matthewlipski avatar matthewlipski commented on August 30, 2024

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.

from blocknote.

TheMikeyRoss avatar TheMikeyRoss commented on August 30, 2024

@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.

from blocknote.

TheMikeyRoss avatar TheMikeyRoss commented on August 30, 2024

I just checked directly in my mongoDB and it has a space between the brackets:

image

but when parsed in the client ui:

image

I consoled logged the notes (before parsing it) and it looks fine with a space between the brackets:

image

So I'm fairly confident the tryParseMarkdownToBlocks is removing a space between the brackets or doing something else wrong

from blocknote.

TheMikeyRoss avatar TheMikeyRoss commented on August 30, 2024

image
the console.log is showing that there's a space between the brackets, but the tryParseMarkdownToBlocks isn't

from blocknote.

TheMikeyRoss avatar TheMikeyRoss commented on August 30, 2024

@matthewlipski or maybe it's replaceBlocks that's removing the space between brackets?

from blocknote.

TheMikeyRoss avatar TheMikeyRoss commented on August 30, 2024

@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
image

So the problem is 100% coming from replaceBlocks

from blocknote.

matthewlipski avatar matthewlipski commented on August 30, 2024

Nice find, thanks for diving into this!

from blocknote.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.