-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toggle summary may be truncated #46
Comments
Correct me if I got your requirement wrong. |
IMHO the toggle summary should be treated like any other paragraph and be rendered fully with annotations indeed, links, etc. The difficulty lies in keeping a functional Markdown output along with HTML tags required to produce the toggle, right ? |
True, maybe I should treat toggle as paragraph, but I'm sure it's going to break a lot of websites using this package. Any preferred format you have in mind? I tried using n2m.setCustomTransformer("toggle", async (block) => {
const { toggle } = block as any;
// console.log(toggle);
let toggle_text = "";
toggle.rich_text.forEach((rich_text: any) => {
toggle_text += n2m.annotatePlainText(
rich_text.plain_text,
rich_text.annotations
);
});
return toggle_text;
}); output: This is a <u>~~**toggle**~~</u> however this won't deal with the toggle children. |
Remember HTML is also supported in markdown docs :) |
Hello,
I'm trying to convert a Notion
/toggle
's summary properly, but it is truncated.This :
is converted as :
This is due to https://github.com/souvikinator/notion-to-md/blob/master/src/notion-to-md.ts#L305 handling
rich_text[0]
only.Directly producing HTML is not this package's purpose and I'd rather output the full summary as Markdown, but outputting
<details>
and<summary>
is probably the only way this can be done.Any idea on how to deal with this properly ?
The text was updated successfully, but these errors were encountered: