vditor
vditor copied to clipboard
表格单元格内文本换行显示异常
编辑模式
请选择你遇到问题时使用的编辑模式(把正常情况模式删掉):
-
ir
即时渲染模式 -
sv
分屏编辑预览模式
描述问题
即时渲染模式下,表格单元格内输入多行文本后,会自动显示为单行。 例如:依次输入 1,换行,2,换行,3 生成的 DOM 结构为:
<td>1<span data-type="inline-node" class="vditor-ir__node"><code class="vditor-ir__marker"><br /></code></span>2<span data-type="inline-node" class="vditor-ir__node"><code class="vditor-ir__marker"><br /></code></span>3</td>
从而导致 <br>
没有被正常渲染
在前面的基础上,切换到 分屏编辑模式,会发现 markdown 源码变成了以下结果:
| col1 | col2 | col3 |
| - | - | - |
| | 1
2
3 | |
| | | |
从而导致,在 分屏模式下 该表格 渲染依然无法正常显示换行;更严重的是:这时候 getValue 得到的 Markdown已经把 123 之间的 <br>
彻底丢失。
实际上正确的 markdown 原文应该为:
| col1 | col2 | col3 |
| - | - | - |
| | 1<br />2<br />3 | |
| | | |
顺便发现的问题
分屏编辑模式中,表格的 |
之间无法输入 <br>
,一旦输入 <b
的时候,光标就会跳转到文本开头
同样遇到该问题,请问有进展么?
最新的3.9.4仍然有这个问题,请问有进展么?
@88250 有空修改一下
收到,我尽量抽空看下是否能搞得定。
---原始邮件--- 发件人: @.> 发送时间: 2023年9月14日(周四) 晚上8:09 收件人: @.>; 抄送: @.@.>; 主题: Re: [Vanessa219/vditor] 表格单元格内文本换行显示异常 (#645)
@88250 有空修改一下
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>