Closed 2234839 closed 3 years ago
重置一下外观还有快捷键以后再试试。
重置一下外观还有快捷键以后再试试。
不行
老铁麻烦发一下 .sy
老铁麻烦发一下 .sy
你将一个块转标题然后再转文档,我就是这样触发的
a2.sy
{
"ID": "20210521213414-dhvrn0v",
"Type": "NodeDocument",
"Properties": {
"id": "20210521213414-dhvrn0v",
"type": "doc",
"updated": "20210521213441"
},
"Children": [
{
"ID": "20210521213415-odphtad",
"Type": "NodeParagraph",
"Properties": {
"id": "20210521213415-odphtad",
"updated": "20210521213425"
},
"Children": [
{
"Type": "NodeBlockRef",
"Data": "span",
"Children": [
{
"Type": "NodeOpenParen"
},
{
"Type": "NodeOpenParen"
},
{
"Type": "NodeBlockRefID",
"Data": "20210521213412-5qmcwh1"
},
{
"Type": "NodeCloseParen"
},
{
"Type": "NodeCloseParen"
}
]
},
{
"Type": "NodeText",
"Data": " "
},
{
"Type": "NodeBlockRef",
"Data": "span",
"Children": [
{
"Type": "NodeOpenParen"
},
{
"Type": "NodeOpenParen"
},
{
"Type": "NodeBlockRefID",
"Data": "20210521213414-dhvrn0v"
},
{
"Type": "NodeCloseParen"
},
{
"Type": "NodeCloseParen"
}
]
}
]
},
{
"ID": "20210521213427-jbp28hm",
"Type": "NodeParagraph",
"Properties": {
"id": "20210521213427-jbp28hm",
"updated": "20210521213437"
},
"Children": [
{
"Type": "NodeText",
"Data": "test "
},
{
"Type": "NodeBlockRef",
"Data": "span",
"Children": [
{
"Type": "NodeOpenParen"
},
{
"Type": "NodeOpenParen"
},
{
"Type": "NodeBlockRefID",
"Data": "20210521213415-odphtad"
},
{
"Type": "NodeCloseParen"
},
{
"Type": "NodeCloseParen"
}
]
}
]
},
{
"ID": "20210521213438-7bh7z5o",
"Type": "NodeParagraph",
"Properties": {
"id": "20210521213438-7bh7z5o",
"updated": "20210521213438"
}
},
{
"ID": "20210521213433-dpvvgo4",
"Type": "NodeParagraph",
"Properties": {
"id": "20210521213433-dpvvgo4",
"updated": "20210521213433"
}
}
]
}
a1.sy
{
"ID": "20210521213412-tcddvom",
"Type": "NodeDocument",
"Properties": {
"id": "20210521213412-tcddvom",
"updated": "20210521213441"
},
"Children": [
{
"ID": "20210521213412-5qmcwh1",
"Type": "NodeParagraph",
"Properties": {
"id": "20210521213412-5qmcwh1",
"updated": "20210521213413"
},
"Children": [
{
"Type": "NodeText",
"Data": "a1"
}
]
}
]
}
这里有个解析上的循环依赖没有解决,即 a 中的块引指向了 a 自己,这个得稍微推后点再处理了,谢谢。
a9 中通过设置最大循环深度 7
来控制,发布以后请帮忙回测,谢谢。
另外还发现一个问题,这里链中链只是引用上一个块,但渲染的结果比较奇怪
正常渲染应该是这样
a9 中通过设置最大循环深度
7
来控制,发布以后请帮忙回测,谢谢。
我在写 oceanpress 的方法是对块的 id 进行检测,只有在一次对文档的渲染中 该id 被嵌套渲染两次才视为循环引用,目前来看效果似乎还不错
- 将一个块转标题然后再转文档,此时该文档内显示不正确。
- 然后再将该文档拖动原来的文档内转标题 ,此时仍然显示不正确。 但直接构建 第二步那样的结构是可以正确显示的
我这里现在似乎重现不了,等 a10 发布以后再看看,谢谢。
问题依然存在
这个问题有点复杂,我估计不能支持循环依赖。wolai 解决这个问题的方案很优秀,后面我们借鉴一下吧。
这个问题有点复杂,我估计不能支持循环依赖。wolai 解决这个问题的方案很优秀,后面我们借鉴一下吧。
在这个场景下似乎还算不得循环依赖,因为块引用不会显示标题块下的内容,以同样的逻辑构建一个块嵌入的才是循环依赖吧
上面这个例子是循环依赖的,之前你举的例子也是的。只要解析路径上出现了循环,就没法解决了,设定深度显示会给用户带了困扰,最好的方式还是直接告诉用户这里有循环依赖,直接打断依赖。
每一个块都在引用上面已经声明的块,我没有明白那里出现了循环
问题出在动态解析锚文本的时候,比如:
a ((id_b))
b ((id_a))
问题出在动态解析锚文本的时候,比如:
a ((id_b)) b ((id_a))
这个确实是循环依赖,但在这个场景下并不构成循环依赖
id1: a1
id2: # a2
id3: 引用 ((id1)) & ((id2))
id4: 引用上一段 ((id3))
思源第一次打开的时候也是可以正确显示的,但在将 a2 转为文档再转回来的时候触发了循环依赖的判断就很奇怪
转换文档那里,a2 会引用 a2 自己。
转换文档那里,a2 会引用 a2 自己。
但块引用是不涉及内容的,只有块嵌入才会。 这里是可以正常解析锚文本的
块引的时候需要渲染锚文本,但锚文本不是渲染时候才解析,而是编辑更新操作时候解析好放到 refs 表里。
块引的时候需要渲染锚文本,但锚文本不是渲染时候才解析,而是编辑更新操作时候解析好放到 refs 表里。
a2 在转文档的时候: 如果 refs 表内没有 a2 : 在转成功之后应该更新一次 如果 refs 表内 a2 还在的话,应该不会有任何问题。
我还是认为这是思源本身的一个问题,而非块之间处于循环引用
刚刚在 我来 尝试了一下,他也是没有将这种情况视作循环引用的
a11 里面稍微调整了一下,等发布以后再看看,谢谢。