jxpeng98 / obsidian-to-NotionNext

Share obsidian markdown file to any Notion database and generate notion share link 同步obsdian文件到任意Notion数据库。
GNU General Public License v3.0
45 stars 4 forks source link

HTTP 400 but full right configuration #25

Open Mairuis opened 3 months ago

Mairuis commented 3 months ago

When the content contains images, it results in 400 errors. However, when I removed all the images, it was successfully processed.

frontmatter: image

Before I remove : image

When I removed images:

image

here's the requested content image

jxpeng98 commented 3 months ago

Hi,

It is strange. Could you share a block of your source code along with an image? I would like to test it on my side and investigate the error.

Thanks.

jxpeng98 commented 2 months ago

Hi, I just check this error with the following notes:

This is a test file.

this is a test image
![test](https://minioapi.pjx.ac.cn/img1/2024/07/0521b0aa6cedbe67bca4966bf79041ea.png)

the output will be generated as:

"children": [
        {
            "object": "block",
            "type": "paragraph",
            "paragraph": {
                "rich_text": [
                    {
                        "type": "text",
                        "annotations": {
                            "bold": false,
                            "strikethrough": false,
                            "underline": false,
                            "italic": false,
                            "code": false,
                            "color": "default"
                        },
                        "text": {
                            "content": "This is a test file."
                        }
                    }
                ]
            }
        },
        {
            "object": "block",
            "type": "paragraph",
            "paragraph": {
                "rich_text": [
                    {
                        "type": "text",
                        "annotations": {
                            "bold": false,
                            "strikethrough": false,
                            "underline": false,
                            "italic": false,
                            "code": false,
                            "color": "default"
                        },
                        "text": {
                            "content": "this is a test image\n"
                        }
                    }
                ]
            }
        },
        {
            "object": "block",
            "type": "image",
            "image": {
                "type": "external",
                "external": {
                    "url": "https://minioapi.pjx.ac.cn/img1/2024/07/0521b0aa6cedbe67bca4966bf79041ea.png"
                }
            }
        }
    ]

However, if I add list bullet in front of the image like:

This is a test file.

this is a test image
* ![test](https://minioapi.pjx.ac.cn/img1/2024/07/0521b0aa6cedbe67bca4966bf79041ea.png)

It can sync successfully. However, the package cannot parse the image

"children": [
        {
            "object": "block",
            "type": "paragraph",
            "paragraph": {
                "rich_text": [
                    {
                        "type": "text",
                        "annotations": {
                            "bold": false,
                            "strikethrough": false,
                            "underline": false,
                            "italic": false,
                            "code": false,
                            "color": "default"
                        },
                        "text": {
                            "content": "This is a test file."
                        }
                    }
                ]
            }
        },
        {
            "object": "block",
            "type": "paragraph",
            "paragraph": {
                "rich_text": [
                    {
                        "type": "text",
                        "annotations": {
                            "bold": false,
                            "strikethrough": false,
                            "underline": false,
                            "italic": false,
                            "code": false,
                            "color": "default"
                        },
                        "text": {
                            "content": "this is a test image"
                        }
                    }
                ]
            }
        },
        {
            "object": "block",
            "type": "bulleted_list_item",
            "bulleted_list_item": {
                "rich_text": []
            }
        }
    ]
jxpeng98 commented 2 months ago

Hi, I updated the plugin with better debugging. Please feel free to have a try.

I checked your syncing. Your note has been translated to 104 blocks

image

However, the Notion API can only support 100 blocks.

image

The only way to solve the sync issue is to shorten the note.