Skip to content

Improve backlink filtering below the heading #14929

Closed
@TCOTC

Description

@TCOTC
Contributor

反链面板搜索过滤会忽略标题块下方的内容

https://ld246.com/article/1748433745638

测试反链.sy.zip

video.webm

Activity

self-assigned this
on May 29, 2025
added this to the 3.1.32 milestone on May 29, 2025
changed the title [-]反链面板搜索过滤会忽略标题块下方的内容[/-] [+]Improve backlink filtering below the heading[/+] on May 29, 2025
zxhd863943427

zxhd863943427 commented on May 29, 2025

@zxhd863943427
Contributor

改进后是能搜索过滤标题下的文本了吗?

TCOTC

TCOTC commented on May 29, 2025

@TCOTC
ContributorAuthor

不能。反链改成会显示标题块的上层容器块

zxhd863943427

zxhd863943427 commented on May 29, 2025

@zxhd863943427
Contributor

@TCOTC 啊,不是很能理解,这是说超级块塞标题块,会把超级块展示出来?

zxhd863943427

zxhd863943427 commented on May 29, 2025

@zxhd863943427
Contributor

然后直接在上层容器块(超级块)里面过滤?

zxhd863943427

zxhd863943427 commented on May 29, 2025

@zxhd863943427
Contributor

真的是这样啊……我感觉这是个诡异的解决方案。

Wetoria

Wetoria commented on May 29, 2025

@Wetoria

简单看了下改动历史,这个 4528be8 改法,是跟之前段落块采用了一样的逻辑吗? @88250

88250

88250 commented on May 29, 2025

@88250
Member
88250

88250 commented on May 29, 2025

@88250
Member

各位看看有没有什么问题,如果影响较大的话就先不做改动了。

Wetoria

Wetoria commented on May 29, 2025

@Wetoria

@zxhd863943427 @Wetoria 是的

目前的反链展示逻辑,我觉得没必要另外改动了。有些人可能就是在标题里用块引,这个改动会破坏这些人的工作流。

如果只是视频中的搜索场景,可以在搜索到 “222” 这一行时返回父级标题块的 ID 就可以了,你看这个改动是否方便。

7 remaining items

zxhd863943427

zxhd863943427 commented on May 30, 2025

@zxhd863943427
Contributor

大致看了下实现,这是先查出标题块的child,之后挨个匹配keyword,假如成立就把对应的父标题块加入到ret里吗?

zxhd863943427

zxhd863943427 commented on May 30, 2025

@zxhd863943427
Contributor

想到一个问题:话说ret里面会进行去重处理吗?

TCOTC

TCOTC commented on May 30, 2025

@TCOTC
ContributorAuthor

确实没有

Image

zxhd863943427

zxhd863943427 commented on May 30, 2025

@zxhd863943427
Contributor

另外refcount好像也没同步更新。

reopened this on May 31, 2025
88250

88250 commented on May 31, 2025

@88250
Member

我这里测试好像正常哦,没有重复:

Image

refcount 不用更新,上面已经更新过了:

Image

Image

两位再帮忙看看。

Wetoria

Wetoria commented on May 31, 2025

@Wetoria

我这里测试好像正常哦,没有重复:

Image

refcount 不用更新,上面已经更新过了:

Image

Image

两位再帮忙看看。

这个结果很合理。

如果真要改进交互效果,我能想到的只有“展示具体命中的块”,前后都用现在的折叠效果。

但是这个改动也不简单,就这样挺好的了。

TCOTC

TCOTC commented on May 31, 2025

@TCOTC
ContributorAuthor

@88250 子块多加一个 222

88250

88250 commented on May 31, 2025

@88250
Member

懂了,是有问题,稍后看看怎么改进。

Wetoria

Wetoria commented on May 31, 2025

@Wetoria

懂了,是有问题,稍后看看怎么改进。

最后返回的 id 列表里做个去重应该就好了吧?

88250

88250 commented on May 31, 2025

@88250
Member

嗯,小改一点:

Image

88250

88250 commented on May 31, 2025

@88250
Member

我先关闭了,各位帮忙测测最新的 dev 版

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @88250@Wetoria@zxhd863943427@TCOTC

      Issue actions

        Improve backlink filtering below the heading · Issue #14929 · siyuan-note/siyuan