Skip to content

使用 API /api/block/updateBlock 更新时 IAL 设置错误 #6725

Closed
@Zuoqiu-Yingyi

Description

@Zuoqiu-Yingyi
Contributor

该问题是否已经被报告过了? Is there an existing issue for this?

  • 我已经搜索了 Issues,没有发现类似问题
    I have searched the existing issues

该问题是否能够在默认主题(daylight/midnight)下重现? Can the issue be reproduced with the default theme (daylight/midnight)?

  • 我能够在默认主题下重现该问题
    I was able to reproduce the issue with the default theme

描述问题 Describe the problem

使用 API /api/block/updateBlock 更新文档块时, 若请求体的 data 字段为如下内容

请求体

# 代码单元格

```python
import time
```
{: id="20221126231947-0000004" custom-jupyter-index="1" custom-jupyter-output="20221126231947-0000005" custom-jupyter-type="code"}
{{{row
---

---
}}}
{: id="20221126231947-0000005" custom-jupyter-index="1" custom-jupyter-code="20221126231947-0000004" custom-jupyter-type="output"}

更新后的文档导出为模板如下所示

文档导出模板

# 代码单元格
{: custom-jupyter-index="1" custom-jupyter-output="20221126231947-0000005" custom-jupyter-type="code" id="20221126231947-0000004"}

```python
import time
```
{: id="20221126232449-1bepkdv"}

{{{row
---
{: id="20221126232449-p86d59u"}

---
{: id="20221126232449-f5ha8zs"}

}}}
{: custom-jupyter-code="20221126231947-0000004" custom-jupyter-index="1" custom-jupyter-type="output" id="20221126231947-0000005"}

可以发现, 为代码块 python 设置的 IAL token {: id="20221126231947-0000004" custom-jupyter-index="1" custom-jupyter-output="20221126231947-0000005" custom-jupyter-type="code"} 却设置到了代码块前的标题块 # 代码单元格, 与预期不符

但是若移除代码块 IAL 的 id 字段({: custom-jupyter-index="1" custom-jupyter-output="20221126231947-0000005" custom-jupyter-type="code"}), 则该 IAL 正常设置到了代码块, 如下所示

请求体

# 代码单元格

```python
import time
```
{: custom-jupyter-index="1" custom-jupyter-output="20221126231947-0000005" custom-jupyter-type="code"}
{{{row
---

---
}}}
{: id="20221126231947-0000005" custom-jupyter-index="1" custom-jupyter-code="20221126231947-0000004" custom-jupyter-type="output"}

文档导出模板

# 代码单元格
{: id="20221126233343-p4rxnj5" updated="20221126233343"}

```python
import time
```
{: custom-jupyter-index="1" custom-jupyter-output="20221126231947-0000005" custom-jupyter-type="code" id="20221126233343-cuplt4n" updated="20221126233343"}

{{{row
---
{: id="20221126233343-y48ju73" updated="20221126233343"}

---
{: updated="20221126233343" id="20221126233343-t49jpcw"}

}}}
{: custom-jupyter-code="20221126231947-0000004" custom-jupyter-index="1" custom-jupyter-type="output" id="20221126231947-0000005" updated="20221126231947"}

期待的结果 Expected result

使用 API /api/block/updateBlock 更新文档块时 IAL 可正常设置

截屏或者录屏演示 Screenshot or screen recording presentation

No response

版本环境 Version environment

- Version: 2.5.1
- Operating System: 
- Browser (if used):

日志文件 Log file

无有效信息输出

更多信息 More information

No response

Activity

self-assigned this
on Nov 27, 2022
added this to the 2.5.2 milestone on Nov 27, 2022
changed the title [-]使用 API `/api/block/updateBlock` 更新文档块时 IAL 设置错误[/-] [+]使用 API `/api/block/updateBlock` 更新时 IAL 设置错误[/+] on Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @88250@Zuoqiu-Yingyi

      Issue actions

        使用 API `/api/block/updateBlock` 更新时 IAL 设置错误 · Issue #6725 · siyuan-note/siyuan