Closed smor closed 2 years ago
Hi there. Thanks for reporting the issue and the PR #44 . For the time your PR will fix the issue so I'll merge it, however I believe this may be the issue with other blocks as well so I'll release a fix in coming days.
Hi,
Thanks for the quick answer and merge ! I think that this would need to be investigated further as well.
Best regards
The fix is now live in v2.5.3
.
Thanks for the contribution :)
Hi,
Thanks for the quick answer and merge ! I think that this would need to be investigated further as well.
Best regards
yes, I'm on it.
Hello,
Thanks for the good work, this package is very useful to me !
General context
I'm trying to build a Notion to Hugo process using notion-to-md, which I simply called notion-to-hugo. I want to use it to build online courses in the most generic way I can, allowing content creators to leverage the full potential of Notion while ensuring that the final website works in our course setup.
I want to be able to customize the rendering process to be able to adapt the generated content for the particular Hugo settings that I use, including
shortcodes
for instance.I use Notion Synced Block to reuse content across pages.
I started to work on a generic pre/post-processing pipeline here. I was very happy to see
setCustomTransformer
emerging, as I like the direction it's heading !The issue
You can see that in this Notion page there is a Notion synced block. When processed with
notion-to-md
, the Markdown MdBlock output is the following :As you can see, the content is indented, leading to the paragraph being converted as a code block by Hugo, which you can see here on the generated HTML page produced by notion-to-hugo through notion-to-md.
Analysis
The block structure produced by notion-to-md is the following :
We can see that the actual content blocks are children of the synced block. The synced block is only a container for actual content, and I don't see any reason why we should treat its children as real children.
The indent is made here :
My guess is that we should not
addTabSpace
to children of blocked whose type issynced_block
.Attempts at solving the issue
I tried the following things :
setCustomTransformer
to deal with the particular case : I did not find a proper way to use it for my case ;toMarkdownString
to deal withsynced_block
: I can't get it to work as I could find no way of determining the parent's type here.I'm feeling stuck, probably by my lack of understanding of some of the processing flows... Would you be able to help me sort it out ? I hope I provided enough information for that.
Thanks a lot !