Skip to content
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

因代码段的长度超过 2000 导致无法导入到 Notion(个例) #6846

Open
AlphaZ19 opened this issue Dec 16, 2024 · 8 comments
Open

Comments

@AlphaZ19
Copy link

描述这个错误

首先已确保全部插件和程序均为最新版本,其他页面也都能正常导入,这个文章在导入到notion时报错,报错信息如下:

{
  "url": "https://blog.csdn.net/m0_58849641/article/details/126126951",
  "object": "error",
  "status": 400,
  "code": "validation_error",
  "message": "body failed validation: body.children[18].code.rich_text[0].text.content.length should be ≤ `2000`, instead was `2536`.",
  "request_id": "c41149dc-6aa2-4a5b-a1d6-1a623a798f49"
}

复现步骤

  1. 打开网页
  2. 进入阅读模式
  3. 点击或者通过快捷键导入Notion

其他相关说明

No response

操作系统

Windows 10 专业版 22H2 19045.5247

浏览器

Microsoft Edge 版本 131.0.2903.99 (正式版本) (64 位)

发生问题的网址

https://blog.csdn.net/m0_58849641/article/details/126126951

@Kenshin
Copy link
Owner

Kenshin commented Dec 16, 2024

okay 收到~

这是因为 Notin Block 对导入的内容有限制,最多不能超过 2000 个造成的。

简单的说,你提供的页面的代码段太长了 😂


我先记录下,看如何优化~

关联 #4955

@Kenshin Kenshin changed the title CSDN页面导入Notion报validation_error 因代码段的长度超过 2000 导致无法导入到 Notion(个例) Dec 16, 2024
@AlphaZ19
Copy link
Author

好的,感谢!

@Kenshin
Copy link
Owner

Kenshin commented Dec 16, 2024

小事情,你可以利用 Live Editor 将代码段先删除,然后再导入到 Notion,之后手动复制代码段的内容到 Notion 临时解决。

@AlphaZ19
Copy link
Author

我已经这么做了,然后发现新的问题,在我删掉最大的两个代码段后,成功导入了,但部分长的代码段我没有删除也没有成功导入

@AlphaZ19
Copy link
Author

以下是报错信息,太长了直接贴文件了
[email protected]

@Kenshin
Copy link
Owner

Kenshin commented Dec 16, 2024

但部分长的代码段我没有删除也没有成功导入

没太理解

以下是报错信息,太长了直接贴文件了 [email protected]

这个错误还是超过 2000 的问题,估计是页面转换为 Notion Block 时,出现了偏差造成的。(结合你上面这个问题)

@AlphaZ19
Copy link
Author

不过问题不大,手动补充了一遍,好的,明白了,还是代码段太长的问题

@Kenshin
Copy link
Owner

Kenshin commented Dec 16, 2024

👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants