I’m sending emails to Notion, as page content and Notion’s API only allows 2,000 characters to be included in a rich text object. So I need to break the email content down into an array of strings, where each string is the next 2,000 characters from the email.
I know that I can use slice() to get characters from a string but I’m not sure how to loop through each block of 2,000 characters and store those as an array.
I need to be able to format each block of content as:
Thanks for sharing this Blueprint, that works great.
In the end, I realised that splitting the text into 2,000 character chunks isn’t a great idea because it would mean that some paragraphs would be split into two separate blocks, when they’re added to the Notion page.
So instead, I’m assuming that my paragraphs will be less than 2,000 characters and creating 1 block per paragraph.