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 89 forks source link

Unified way to handle links #75

Closed Radiergummi closed 1 year ago

Radiergummi commented 1 year ago

I'm struggling with inline links to other pages in Notion content. Contrary to what one might expect, those aren't reported as link_to_page, but will silently be passed to md.link():

if (content["href"])
  plain_text = md.link(plain_text, content["href"]);

parsedData += plain_text;

See /src/notion-to-md.ts#L398-L401

In this case, href might be /fae18db43ae240bbb05771a6e531b494, which makes it hard to detect valid links and replace them with references to the local pages.

A good solution would be to pass those to some kind of (new?) link transformer, if available.

souvikinator commented 1 year ago

Currently saving child pages as a separate file is a work in progress (#71). I hope that'll fix this issue.

souvikinator commented 1 year ago

The feature is now live in v2.6.0. Does it solve the issue?

souvikinator commented 1 year ago

Closing the issue. Feel free to reopen it.