We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
/api/block/updateBlock
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
使用 API /api/block/updateBlock 不能更新文档块, 请求体与响应体如下所示, 但是文档不会更新
// 请求体 { "id": "20200812220555-lj3enxa", "dataType": "markdown", "data": "" } // 响应体 { "code": 0, "msg": "", "data": [ { "doOperations": [ { "action": "update", "data": "<div data-node-id=\"20200812220555-lj3enxa\" data-node-index=\"1\" data-type=\"NodeParagraph\" class=\"p\" updated=\"20220306121715\"><div contenteditable=\"true\" spellcheck=\"false\"></div><div class=\"protyle-attr\" contenteditable=\"false\"></div></div>", "id": "20200812220555-lj3enxa", "parentID": "", "previousID": "", "retData": null } ], "undoOperations": null } ] }
将文档块渲染为 data 字段的内容
data
目前由于编辑区的动态加载功能, 无法全选整篇文档的内容, 因此无法在保留文档块的前提下删除文档块内部全部内容, 而使用 API 也无法实现该功能:
/api/filetree/removeDoc
The text was updated successfully, but these errors were encountered:
刚刚有朋友发现了一个问题 删除文档内容 · Issue #47, 使用该 API 更新文档块时, 如果请求体 data 字段设置为空字符串 "" 或者只有换行符 "\n" "\n\n" 的字符串, 如果该文档已经在编辑器中打开, 那么被更新的文档 DOM 会如下所示, 一个块都没有
""
"\n"
"\n\n"
<div class="protyle-wysiwyg protyle-wysiwyg--attr" spellcheck="false" contenteditable="true" style="padding: 16px 96px 380.5px;" data-doc-type="NodeDocument"></div>
关闭该文档后再重新打开又出现了两个空的段落块
但是空文档块应该存在一个空的段落块, 如下所示
<div class="protyle-wysiwyg protyle-wysiwyg--attr" spellcheck="false" contenteditable="true" data-doc-type="NodeDocument" style="padding: 16px 96px 380.5px;"> <div data-node-id="20220513185535-5uuae2l" data-node-index="0" data-type="NodeParagraph" class="p" updated="20220513185535"> <div contenteditable="true" spellcheck="false"></div> <div class="protyle-attr" contenteditable="false"></div> </div> </div>
Sorry, something went wrong.
88250
Vanessa219
No branches or pull requests
描述问题 Describe the problem
使用 API
/api/block/updateBlock
不能更新文档块, 请求体与响应体如下所示, 但是文档不会更新期待的结果 Expected result
将文档块渲染为
data
字段的内容版本环境 Version environment
更多信息 More information
目前由于编辑区的动态加载功能, 无法全选整篇文档的内容, 因此无法在保留文档块的前提下删除文档块内部全部内容, 而使用 API 也无法实现该功能:
/api/filetree/removeDoc
会将文档块整个删除, 关联该文档块的引用与超链接全部失效The text was updated successfully, but these errors were encountered: