souvikinator / notion-to-md

Convert notion pages, block and list of blocks to markdown (supports nesting and custom parsing)
https://www.npmjs.com/package/notion-to-md
MIT License
1.08k stars 90 forks source link

Broken blockquotes #34

Closed raphtlw closed 2 years ago

raphtlw commented 2 years ago

This

Screenshot 2022-06-19 at 4 52 26 PM

When converted to markdown using this package, looks like:

> 

        Your mind is for having ideas, not holding them.

When it should have been rendered as:

> Your mind is for having ideas, not holding them.

On the website, it gets rendered as a code block, which is not what I expected.

Screenshot 2022-06-19 at 4 54 56 PM

Will try my best to fork and create a pull request to resolve this issue. If you've got the time, please offer guidance on how this issue can be fixed, thank you.

souvikinator commented 2 years ago

Hi there, @raphtlw

Are all the test results passing? Try running test using npm run test Also may I know the version of notion-to-md you are using? Latest is v2.3.4

Not sure what's the issue here. Everything is working fine from my end. Here are the outputs:

Notion:

image

Output:

image

raphtlw commented 2 years ago
  1. All test results have passed. Screenshot 2022-06-19 at 11 01 30 PM
  2. I just checked the version, it is in fact, v2.3.4.
raphtlw commented 2 years ago

This is how I am using this library:

Screenshot 2022-06-19 at 11 03 18 PM
raphtlw commented 2 years ago

Okay, I can now confirm it's got to do with something on my end. Not sure what it is exactly, but i'll figure it out. It seems to work if I put the same block in an empty page, but not when it's part of another pages content.

Renders perfectly when standalone:

Screenshot 2022-06-19 at 11 09 04 PM

Not when together with other blocks:

Screenshot 2022-06-19 at 11 10 07 PM
souvikinator commented 2 years ago

That's weird because it should also work with other blocks as you can see in the screenshots I have shared. Can you share the markdown response in both cases?

raphtlw commented 2 years ago

Here is part of the mdBlocks output from the original Notion page:

image

It looks alright, but the logged mdString shows this:

Screenshot 2022-06-19 at 11 33 12 PM

Very weird behaviour indeed. Nothing is being modified in between.

raphtlw commented 2 years ago

Holy shit I'm so sorry, the Notion page was broken where the blockquote was located, causing the quote to be somehow indented multiple lines, even though I couldn't see it. It looked normal, but I went to backspace and rewrite the whole block again and it got fixed. Apologies and thank you for making time to build such an awesome tool!

souvikinator commented 2 years ago

Ah I see. Thanks for using notion-to-md :))