Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

符号转义后无法被搜出 #4469

Closed
Temacc0531 opened this issue Apr 2, 2022 · 6 comments
Closed

符号转义后无法被搜出 #4469

Temacc0531 opened this issue Apr 2, 2022 · 6 comments
Assignees
Labels
Milestone

Comments

@Temacc0531
Copy link

Temacc0531 commented Apr 2, 2022

描述问题 Describe the problem

符号转义后无法被搜出

复现步骤:

  1. 文章内有*号,搜索*正常被搜出
  2. *号前加入\转义
  3. 再次搜索*无法被搜出

期待的结果 Expected result

符号转义后仍然可以被搜出,搜索*可以搜出未转义与已转义,搜索\*可以搜出已转义

版本环境 Version environment

  • Version: v1.9.6
  • Operating system: Windows 10/11

更多信息 More information

搜索的时候能否加入区分出哪些是未转义哪些是已转义的功能(比如说已转义的可以通过\*搜出),这个缺陷是在我准备将笔记中所有的未转义符号都转义发现的,或者是否有其他更好的办法

@88250 88250 self-assigned this Apr 3, 2022
@88250 88250 added this to the 1.9.7 milestone Apr 3, 2022
@88250 88250 closed this as completed Apr 3, 2022
@88250 88250 added Bug and removed Enhancement labels Apr 3, 2022
@Temacc0531
Copy link
Author

升级1.9.7后,我尝试搜索原有的笔记,发现依旧只能搜出未转义,但是我新建一个笔记来测试是搜出已转义和未转义的,我猜测应该是原有笔记还是按老版本存储的原因,有什么办法可以把所有文档刷新一下吗

@88250
Copy link
Member

88250 commented Apr 7, 2022

文档树面板 ... 菜单,重建索引。

@Temacc0531
Copy link
Author

Temacc0531 commented Apr 8, 2022

重建索引完毕,还是发现有两个小问题

  1. 对于*以外的符号,如- ~等,搜索\-会搜出已转义和未转义,期望应该是只搜出已转义
  2. 搜索*\*高亮异常,不是高亮在目标上

@88250
Copy link
Member

88250 commented Apr 8, 2022

这两个问题暂时无法解决,因为会匹配到 SQL 查询的通配符。

@Temacc0531
Copy link
Author

我猜测是否与正则匹配有关,能否像Sublime一样单独设置正则匹配开关来解决这个问题
当然这些也只是我粗浅的猜测,如果实在无法解决的话,能否先记录下来,期待后续解决

@88250
Copy link
Member

88250 commented Apr 8, 2022

的确和正则也有关系,这问题比较麻烦,暂时先这样。理论上比较好的方案应该是通过搜索引擎内置的高亮函数处理,但是目前我们没有用 SQLite 搜索引擎,而是直接数据库查询的,所以高亮只能在外围来实现,在外围实现的话就会遇到正则和标记符匹配的问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants