Skip to content

使用 HTML 块时建议使用 <div> 包裹 HTML 代码 #5732

Closed
@a15355447898a

Description

@a15355447898a
Contributor

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

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

描述问题 Describe the problem

建立了一个html块,其中包含

<pre style="margin-bottom: 0; border-bottom:none; padding-bottom:0.8em;">/etc/mkinitcpio.conf</pre>
<pre style="margin-top: 0; border-top-style:dashed; padding-top: 0.8em;">HOOKS=(base <b>udev</b> ... block <b>lvm2</b> filesystems)</pre>

在重启SiYuan后发现只剩下了

<pre style="margin-bottom: 0; border-bottom:none; padding-bottom:0.8em;">/etc/mkinitcpio.conf</pre>

期待的结果 Expected result

应该可以完整保存的啊?

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

https://www.aliyundrive.com/s/7d9vqWUiwEY

版本环境 Version environment

- Version: 2.1.9
- Operating System: Windows11
- Browser (if used):

日志文件 Log file

siyuan.log

更多信息 More information

另外,编写完这个html块后(不退出),按ctrl+z,会出现
image

Activity

changed the title [-]编写了一个html块,关闭再重新打开SiYuan后发现其中的代码丢失了一部分[/-] [+]HTML 块中包含多个 `<pre>` 时只能保存第一个[/+] on Aug 27, 2022
added this to the 2.1.10 milestone on Aug 27, 2022
88250

88250 commented on Aug 27, 2022

@88250
Member

这个问题主要是因为 Markdown 语法解析生成了两个 HTML 块:

image

如果用 <div> 包裹 <pre> 的话就是一个 HTML 块:

image

对于前面不包裹的情况,会弹出提示信息建议用户使用 <div> 包裹 HTML 代码。

added a commit that references this issue on Aug 27, 2022
changed the title [-]HTML 块中包含多个 `<pre>` 时只能保存第一个[/-] [+]使用 HTML 块时建议使用 `<div>` 包裹 HTML 代码[/+] on Aug 28, 2022
added a commit that references this issue on Aug 28, 2022
added a commit that references this issue on Sep 7, 2022

7 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @88250@Vanessa219@qiuzhiqian@a15355447898a

      Issue actions

        使用 HTML 块时建议使用 `<div>` 包裹 HTML 代码 · Issue #5732 · siyuan-note/siyuan