-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
该问题是否已经被报告过了? Is there an existing issue for this?
- 我已经搜索了 Issues,没有发现类似问题
I have searched the existing issuesTo pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
描述问题 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
更多信息 More information
Metadata
Metadata
Assignees
Labels
Type
Projects
Relationships
Development
Select code repository
Activity
[-]编写了一个html块,关闭再重新打开SiYuan后发现其中的代码丢失了一部分[/-][+]HTML 块中包含多个 `<pre>` 时只能保存第一个[/+]88250 commentedon Aug 27, 2022
这个问题主要是因为 Markdown 语法解析生成了两个 HTML 块:
如果用
<div>
包裹<pre>
的话就是一个 HTML 块:对于前面不包裹的情况,会弹出提示信息建议用户使用
<div>
包裹 HTML 代码。✅ 增加测试用例 siyuan-note/siyuan#5732
[-]HTML 块中包含多个 `<pre>` 时只能保存第一个[/-][+]使用 HTML 块时建议使用 `<div>` 包裹 HTML 代码[/+]:meno: fix #5732
🎨 使用 HTML 块时建议使用 `<div>` 包裹 HTML 代码 #5732
🎨 使用 HTML 块时建议使用 `<div>` 包裹 HTML 代码 #5732
Squashed commit of the following:
Squashed commit of the following:
qiuzhiqian commentedon Dec 2, 2022
你好,请问该问题是还存在吗,我再思源2.5.2版本上面,使用html块插入html文本,预览是可以生效的,然后关掉这个文档页面,重新打开页面后,html就变成纯文本了。

可以正常预览

重新关闭这个页面后重新打开

qiuzhiqian commentedon Dec 2, 2022
不太确定是不是我的使用方式不正确
88250 commentedon Dec 2, 2022
@qiuzhiqian 需要使用 div 包裹
qiuzhiqian commentedon Dec 2, 2022
@88250 嗯,我的理解,对于一个普通用户而言,如果没有特殊提现,他一般是不知道需要包裹一个div的,那么这个div是否应该由软件来自动处理一下比较好。而且我上面的这个例子中,好像确实没有看到任何提示说需要用div包裹。关键是不重启的时候还预览生效了,也并没有包任何错误
88250 commentedon Dec 2, 2022
目前会提示多个 HTML 块没有 div 包裹时数据丢失的情况:
如果是行级元素的话没有提示,这个我们考虑下是否能像你说的,自动通过 div 包裹。
<div>
包裹 #6764