Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
Can the issue be reproduced with the default theme (daylight/midnight)?
- I was able to reproduce the issue with the default theme
Could the issue be due to extensions?
- I've ruled out the possibility that the extension is causing the problem.
Describe the problem
无法在表格输入含有 \|
符号的公式
输入后 \|
后刷新一次会变成 |
示例: 在表格内公式中输入 333 \| bar \| 444
后再刷新文档, 该公式会变成 333 | bar | 444
该问题产生的原因: Lute 无法正确解析表格中的行内公式
含有符号 |
的行内公式在表格中 应按照如下方案进行转义
$111 | foo | 222$
| |
| ------------------- |
| $111 \| foo \| 222$ |
---
$333 \| bar \| 444$
| |
| --------------------- |
| $333 \\| bar \\| 444$ |
当前使用的方案
$111 | foo | 222$
| |
| ---- |
| $111 | foo | 222$ |
---
$333 \| bar \| 444$
| |
| ---- |
| $333 | bar | 444$ |
受影响的方法
- Markdown import
- Markdown export
- database
markdown
field - kernel API
/api/export/exportMdContent
- kernel API
/api/block/getBlockKramdown
lute.BlockDOM2StdMd
lute.BlockDOM2Md
Expected result
$111 | foo | 222$
在表格中表示为
| |
| ------------------- |
| $111 \| foo \| 222$ |
$333 \| bar \| 444$
在表格中表示为
| |
| --------------------- |
| $333 \\| bar \\| 444$ |
Screenshot or screen recording presentation
No response
Version environment
- Version: 2.10.6
- Operating System:
- Browser (if used):
Log file
无有效信息输出
More information
No response
Metadata
Metadata
Assignees
Type
Projects
Relationships
Development
No branches or pull requests
Activity
88250 commentedon Sep 20, 2023
能够解决这个情况:
但是对于这个情况无法解决(因为解析器解析块级表格
|
优先级高于行级):[-]Can't correct handle inline formula in table[/-][+]Improve the handling of inline-level formulas containing escape char `\` in the table[/+]🎨 Protyle Improve the handling of inline-level formulas containing es…
🎨 Protyle Improve the handling of inline-level formulas containing es…
🎨 Improve the handling of inline-level formulas containing escape cha…
Zuoqiu-Yingyi commentedon Sep 20, 2023
保证表格内行内公式与表格外行内公式相同的内容渲染一致即可
88250 commentedon Sep 20, 2023
Zuoqiu-Yingyi commentedon Sep 20, 2023
我拉取后试了一下, 发现导出预览模式下依旧未正确渲染
该问题同时影响导出的内容
88250 commentedon Sep 20, 2023
多谢测试,稍后再改改。
🎨 Protyle Improve the handling of inline-level formulas containing es…
Zuoqiu-Yingyi commentedon Sep 20, 2023
现在貌似引入了更多问题...
1. 表格中行内公式中的
|
在刷新后均被替换为\|
2. 表格中行内公式中的
\\|
在刷新后无法正确解析\
+\
可以正确解析\
+|
无法正确解析42 remaining items
🎨 Improve the handling of inline-math containing `|` in the table #9227
88250 commentedon Sep 24, 2023
感谢测试,已经修改提交,这次应该差不多了。
Zuoqiu-Yingyi commentedon Sep 24, 2023
之前已经修复的问题再次出现了...
模板
渲染结果:

期待的导出内容:
实际导出内容:
88250 commentedon Sep 25, 2023
我看你上面回复的是这个期待哦:
Zuoqiu-Yingyi commentedon Sep 25, 2023
图中里面转换前的内容是指非表格内的公式导出的内容,转换后的内容是指表格内公式导出的内容
Zuoqiu-Yingyi commentedon Sep 25, 2023
再详细描述一下导出需求
需求 1
希望导出为
需求 2
希望导出为
需求 3
希望导出为
🎨 Protyle Improve the handling of inline-math containing `|` in the t…
88250 commentedon Sep 25, 2023
@Zuoqiu-Yingyi 好的,叒改了改,麻烦测试。
🎨 Improve the handling of inline-math containing `|` in the table #9227
Zuoqiu-Yingyi commentedon Sep 25, 2023
还是不行啊, 满足
需求 2
与需求 3
, 但仍不满足需求 1
:期望导出为
实际导出为
🎨 Protyle Improve the handling of inline-math containing `|` in the t…
🎨 Protyle Improve the handling of inline-math containing `|` in the t…
🎨 Protyle Improve the handling of inline-math containing `|` in the t…
🎨 Improve the handling of inline-math containing `|` in the table #9227
88250 commentedon Sep 25, 2023
感谢测试,这次应该都解决了,相关测试用例已经在 Lute 中添加。