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.11k stars 91 forks source link

Missing tab spaces for text with new line #21

Closed vildar closed 2 years ago

vildar commented 2 years ago

Nested Text with multiple new lines has a tab appended only at the beginning of the text.

Text: lorem ipsum\nlorem ipsum Expected Result:

    lorem ipsum
    lorem ipsum

Outcome:

    lorem ipsum
lorem ipsum
souvikinator commented 2 years ago

Notion: image

Markdown Output: image

works from my end. Can you share how the text looks in notion?

srijitcoder commented 2 years ago

@souvikinator

Notion:

Screenshot 2022-02-09 at 1 25 49 PM

Markdown output and view:

Screenshot 2022-02-09 at 1 28 27 PM

Expected output and view:

Screenshot 2022-02-09 at 1 29 33 PM

So basically the library is only adding indentation to the first line of the nested blocks. We need to add indentation to all the nested blocks' lines... Codeblocks, tables are affected because of this, because these elements have multiple lines in it

@vildar's PR will resolve this issue

souvikinator commented 2 years ago

Merged the PR. Will create a new release shortly. Thanks for the contribution.