From 4dbf66d4416f728129c72a74b60981afa838c659 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Thu, 30 Dec 2021 16:39:09 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E6=8F=90=E4=BE=9B=E6=8F=92?= =?UTF-8?q?=E5=85=A5=E5=9D=97=E3=80=81=E6=9B=B4=E6=96=B0=E5=9D=97=E5=92=8C?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=9D=97=E7=9A=84=20API=20https://github.com?= =?UTF-8?q?/siyuan-note/siyuan/issues/3334?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- API.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/API.md b/API.md index 5d22ce9da..2bf257dcd 100644 --- a/API.md +++ b/API.md @@ -480,6 +480,48 @@ * `action.data`:新插入块生成的 DOM * `action.id`:新插入块的 ID +### 更新块 + +* `/api/block/updateBlock` +* 参数 + + ```json + { + "dataType": "markdown", + "data": "foobarbaz", + "id": "20211230161520-querkps" + } + ``` + + * `dataType`:待更新数据类型,值可选择 `markdown` 或者 `dom` + * `data`:带更新的数据 + * `id`:待更新块 ID +* 返回值 + + ```json + { + "code": 0, + "msg": "", + "data": [ + { + "doOperations": [ + { + "action": "update", + "data": "
foobarbaz
", + "id": "20211230161520-querkps", + "parentID": "", + "previousID": "", + "retData": null + } + ], + "undoOperations": null + } + ] + } + ``` + + * `action.data`:更新块生成的 DOM + ## 属性 ### 设置块属性