mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
🐛 [[ 引用动态锚文本长度限制无效 Fix https://github.com/siyuan-note/siyuan/issues/6566
This commit is contained in:
parent
2bb12d67aa
commit
b110db9c59
1 changed files with 4 additions and 8 deletions
|
|
@ -117,11 +117,8 @@ func SearchRefBlock(id, rootID, keyword string, beforeLen int) (ret []*Block, ne
|
||||||
if nil == block {
|
if nil == block {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
block.Content = maxContent(block.Content, Conf.Editor.BlockRefDynamicAnchorTextMaxLen)
|
block.RefText = sql.GetRefText(block.ID)
|
||||||
block.RefText = block.Content
|
block.RefText = maxContent(block.RefText, Conf.Editor.BlockRefDynamicAnchorTextMaxLen)
|
||||||
if block.IsContainerBlock() {
|
|
||||||
block.RefText = block.FContent // `((` 引用列表项时使用第一个子块作为动态锚文本 https://github.com/siyuan-note/siyuan/issues/4536
|
|
||||||
}
|
|
||||||
ret = append(ret, block)
|
ret = append(ret, block)
|
||||||
}
|
}
|
||||||
if 1 > len(ret) {
|
if 1 > len(ret) {
|
||||||
|
|
@ -135,9 +132,9 @@ func SearchRefBlock(id, rootID, keyword string, beforeLen int) (ret []*Block, ne
|
||||||
trees := map[string]*parse.Tree{}
|
trees := map[string]*parse.Tree{}
|
||||||
for _, b := range ret {
|
for _, b := range ret {
|
||||||
hitFirstChildID := false
|
hitFirstChildID := false
|
||||||
b.RefText = b.Content
|
b.RefText = sql.GetRefText(b.ID)
|
||||||
|
b.RefText = maxContent(b.RefText, Conf.Editor.BlockRefDynamicAnchorTextMaxLen)
|
||||||
if b.IsContainerBlock() {
|
if b.IsContainerBlock() {
|
||||||
b.RefText = b.FContent // `((` 引用列表项时使用第一个子块作为动态锚文本 https://github.com/siyuan-note/siyuan/issues/4536
|
|
||||||
|
|
||||||
// `((` 引用候选中排除当前块的父块 https://github.com/siyuan-note/siyuan/issues/4538
|
// `((` 引用候选中排除当前块的父块 https://github.com/siyuan-note/siyuan/issues/4538
|
||||||
tree := trees[b.RootID]
|
tree := trees[b.RootID]
|
||||||
|
|
@ -154,7 +151,6 @@ func SearchRefBlock(id, rootID, keyword string, beforeLen int) (ret []*Block, ne
|
||||||
}
|
}
|
||||||
|
|
||||||
if b.ID != id && !hitFirstChildID && b.ID != rootID {
|
if b.ID != id && !hitFirstChildID && b.ID != rootID {
|
||||||
b.Content = maxContent(b.Content, Conf.Editor.BlockRefDynamicAnchorTextMaxLen)
|
|
||||||
tmp = append(tmp, b)
|
tmp = append(tmp, b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue