Closed Soneji closed 3 years ago
Hi, @Soneji. Thank you for reporting the issue in detail!
I am going to try to reproduce this problem and analyze your PR #16.
Fixed on v1.1.2 and PRs #16 and #17. @Soneji, here is your rendered HTML example after fixed conversion
Nice content by the way. I hope notion-page-to-html
keeps helping people to publish contents like this.
Thank you for the kind words! 🙌 And thank you for the amazing tool that makes this possible!!
(if you want to subscribe 👀 https://dhavalsoneji.com/blog )
Hi I seem to be having an issue with uploaded images.
This is the URL I am trying to use with the module https://www.notion.so/dhavalsoneji/2c5dd1f8b26840d7ba882d1490a4a917
I get this error:
Which is happening because
stringData
is trying to be JSON parsed, but its value is:Which b64 decodes to:
I believe this is happening due to an image I uploaded to notion for the page cover. The API by default doesn't give us a useful URL to get the image. It will give something like: https://s3-us-west-2.amazonaws.com/secure.notion-static.com/40b79211-1ae6-427f-8b3f-85216732792a/Untitled.png Which is inaccessible
I think a solution is to check if the image url contains notion's aws and use notion's image endpoint
Where
id
is the ID of the page.This should give something like: https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F40b79211-1ae6-427f-8b3f-85216732792a%2FUntitled.png?table=block&id=2c5dd1f8-b268-40d7-ba88-2d1490a4a917
Which is properly accessible