-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add a kernel API /api/block/getBlockTreeInfos
#11311
Comments
有两个疑问:
|
|
谢谢,我明白需求了,现在讨论一下参数和返回值: 上面提到的返回值是个 id 数组,这个需要和前面的参数 id 数组中的值一一对应吗? |
最好是能一一对应。 |
好的,大致明白了,后面考虑下。 |
88250
changed the title
API 请求 | 将列表块的第一个子块转换为列表
Add a kernel API May 9, 2024
/api/block/getBlockTreeInfos
88250
added a commit
that referenced
this issue
May 9, 2024
接口: 参数: {
"ids": ["20240509230443-ppo72zq", "20240509230443-ghcj2tr", "20240509230453-u1k5z6p"]
} 返回值: {
"code": 0,
"msg": "",
"data": {
"20240509230443-ghcj2tr": {
"id": "20240509230443-ghcj2tr",
"type": "NodeParagraph",
"parentID": "20240509230443-ppo72zq",
"parentType": "NodeListItem",
"previousID": "",
"previousType": "",
"nextID": "",
"nextType": ""
},
"20240509230443-ppo72zq": {
"id": "20240509230443-ppo72zq",
"type": "NodeListItem",
"parentID": "20240509230443-7l5nvls",
"parentType": "NodeList",
"previousID": "",
"previousType": "",
"nextID": "",
"nextType": ""
},
"20240509230453-u1k5z6p": {
"id": "20240509230453-u1k5z6p",
"type": "NodeParagraph",
"parentID": "20240509230446-xz4u1uy",
"parentType": "NodeBlockquote",
"previousID": "",
"previousType": "",
"nextID": "",
"nextType": ""
}
}
} |
可以可以,超出我的预期了,感谢D大👍 |
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
API 请求 | 将列表块的第一个子块转换为列表
In what scenarios do you need this feature?
思源中列表项和列表项的第一个内容块经常性的傻傻分不清,在做 SQL 查询的时候经常带来一些麻烦之处。
一个常见的场景是:在编写插件的时候,需要通过 SQL 查询到块,并新建一个 Protyle 进行展示。
但是由于无法区分列表项和列表的第一个节点元素,所以本来应该渲染为列表项的元素被“错误”地渲染为段落块。
希望能够提供一个 API,以有效地处理这个问题。
Describe the optimal solution
给定一堆 block id,后端遍历列表:
/api/sql/checkitem
(这个endpoint不一定合适,开发者可以自行斟酌){ id: [] //block id 列表 }
{ id: [] }
Describe the candidate solution
No response
Other information
No response
The text was updated successfully, but these errors were encountered: