Skip to content

嵌入块中脚本换行时导出为模板后不能正确解析 #3629

Closed
@Zuoqiu-Yingyi

Description

@Zuoqiu-Yingyi
Contributor

描述问题 Describe the problem

文章中有一个嵌入块中含有如下语句

select
    *
from
    blocks
where
    updated > '2021121900000000'
    and updated < '2021122000000000'
ORDER by
    updated desc
limit
    100

将其导出为模板后的对应内容为

{{select
    *
from
    blocks
where
    updated &gt; 2021121900000000'
    and updated &lt; '2021122000000000'
ORDER by
    updated desc
limit
    100}}
{: id="20211219204448-slc61cq"}

显然该模板因为 SQL 语句换行的问题无法正常解析

期待的结果 Expected result

导出模板时嵌入块的 SQL 语句删除换行, 使得可以正常解析该模板, 如下所示

{{select * from blocks where updated &gt; '2021121900000000' and updated &lt; '2021122000000000' ORDER by updated desc limit 100}}
{: id="20211219204448-slc61cq"}

或者可以正确解析多行 SQL 语句

Activity

changed the title [-]含有多行 SQL 语句的文章导出时未删除换行符[/-] [+]含有多行 SQL 语句的文章导出为模板后不能正确解析[/+] on Dec 19, 2021
changed the title [-]含有多行 SQL 语句的文章导出为模板后不能正确解析[/-] [+]含有嵌入块的文章导出为模板后不能正确解析[/+] on Dec 19, 2021
changed the title [-]含有嵌入块的文章导出为模板后不能正确解析[/-] [+]嵌入块中脚本换行时导出为模板后不能正确解析[/+] on Dec 22, 2021
self-assigned this
on Dec 22, 2021
modified the milestones: backlog, 1.5.5 on Dec 22, 2021
88250

88250 commented on Dec 23, 2021

@88250
Member

换行替换为空格。

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

        嵌入块中脚本换行时导出为模板后不能正确解析 · Issue #3629 · siyuan-note/siyuan