zk-org / zk

A plain text note-taking assistant
https://zk-org.github.io/zk/
GNU General Public License v3.0
1.71k stars 131 forks source link

Links containing accents are not matching the target note #47

Closed danymat closed 3 years ago

danymat commented 3 years ago

Hello, I'm starting to use your scripts in order to filter my notes. I found that zk list --orphan does return a lot of notes for me. However I don't have this in neuron or obsidian. Is it normal?

mickael-menu commented 3 years ago

Could you share an example of a note A that shouldn't be orphan? With:

danymat commented 3 years ago

Sure!: (all paths are from the same directory)

  1. Path to note 202102251018:
202102251018 La slip-box est un phénomène récent et ne peut pas être prouvé utile.md
  1. Path to note 202102241246 which links to 202102251018:
202102241246 §1 Zettelkasten.md
  1. The syntax of the link:
 ## Inquiétudes

 - [[202102251018 La slip-box est un phénomène récent et ne peut pas être prouvé utile]]

Note: I'm on macOS 11.4, all notes are created in this computer

mickael-menu commented 3 years ago

Looks like it's failing because of the accents. It could be an issue with the FS normalization, sometimes accents are not normalized to the same unicode characters between file paths and keyboard input.

Until this is fixed, you could also just use the ID prefix for your links. Not sure it works with Obsidian but this is a best practice to make sure you can retitle your notes without breaking your links.

 ## Inquiétudes

 - [[202102251018]]

You can either add the title after the link if you want some context, or use zk's LSP server to automatically report the note title as a diagnostic: https://github.com/mickael-menu/zk/issues/22#issuecomment-841872435

Screenshot 2021-05-16 at 21 44 05
danymat commented 3 years ago

Thank you!

mickael-menu commented 3 years ago

@danymat This is fixed in https://github.com/mickael-menu/zk/pull/49, would you mind checking it before I merge the PR? Thanks.

You will need to run zk index --force with the updated zk to reindex the wiki links.

zk-v0.5.0-1-g3dd4d3a-linux-amd64.tar.gz zk-v0.5.0-1-g3dd4d3a-linux-arm64.tar.gz zk-v0.5.0-1-g3dd4d3a-linux-i386.tar.gz zk-v0.5.0-1-g3dd4d3a-macos-x86_64.zip

danymat commented 3 years ago

Hello @mickael-menu , I hope you're doing right Thank's a lot for improving the application and caring about your users. Unfortunately, I still have issues... I made my repo public if you want to test the notes in your machine : https://github.com/danymat/Brain

mickael-menu commented 3 years ago

@danymat I get only 9 orphan notes using zk list --orphan in your repo, after running zk index --force with the updated build. Did you try with one of the following prebuilt binaries? The fix is not yet in develop.

zk-v0.5.0-1-g3dd4d3a-linux-amd64.tar.gz zk-v0.5.0-1-g3dd4d3a-linux-arm64.tar.gz zk-v0.5.0-1-g3dd4d3a-linux-i386.tar.gz zk-v0.5.0-1-g3dd4d3a-macos-x86_64.zip

danymat commented 3 years ago

@danymat I get only 9 orphan notes using zk list --orphan in your repo, after running zk index --force with the updated build. Did you try with one of the following prebuilt binaries? The fix is not yet in develop.

zk-v0.5.0-1-g3dd4d3a-linux-amd64.tar.gz zk-v0.5.0-1-g3dd4d3a-linux-arm64.tar.gz zk-v0.5.0-1-g3dd4d3a-linux-i386.tar.gz zk-v0.5.0-1-g3dd4d3a-macos-x86_64.zip

I tried by compiling zk in the opened branch (because running the pre-compiled version for macOS you specified returns me an error with icu4c, as latest version for icu4c in brew is 69.1)

mickael-menu commented 3 years ago

I'm not sure what's wrong then. Can you confirm you ran zk index --force with the new build? I'll assume the fix is correct since I could test it on your repo and will merge it. We'll see in the next release if that helps you out.

I tried by compiling zk in the opened branch (because running the pre-compiled version for macOS you specified returns me an error with icu4c, as latest version for icu4c in brew is 69.1)

Ha interesting, I didn't know that could be an issue. I'll make sure to upgrade my icu4c for the next one, and will check if I can package the lib directly in zk somehow. Thanks for the feedback.

danymat commented 3 years ago

I'm not sure what's wrong then. Can you confirm you ran zk index --force with the new build? I'll assume the fix is correct since I could test it on your repo and will merge it. We'll see in the next release if that helps you out.

When doing zk --version I get: zk 0.5.0-5-g0c3b965 I did git checkout fix/wikilinks and ./go build, and replaced my previous compiled version with this new one.

And in confirm I did zk index --force, I still deleted .zk/ folder

mickael-menu commented 3 years ago

What you did looks correct to me.

I merged the PR in main and built a new version after upgrading my icu4c: zk-v0.5.0-4-g5b877dd-macos-x86_64.zip

You can check directly if the fix works by looking at the links table of the .zk/notebook.db SQLite database.

With the old build, the accents are messed up:

Screenshot 2021-06-23 at 21 54 01

After running zk index --force, I get:

Screenshot 2021-06-23 at 21 55 04

(Let me know if you want me to remove the screenshots)

danymat commented 3 years ago

Hello, sorry about the time off. I did reindex the notes with the newest zk build:

Capture d’écran 2021-07-02 à 12 34 12
mickael-menu commented 3 years ago

Closing as it should be fixed in the latest 0.6.0 version.

danymat commented 1 year ago

Hello, it seems the problem is back again. What kind of information/logs do you need to better analyse the issue ?

mickael-menu commented 1 year ago

@danymat If you could come up with a .tesh file reproducing the issue that would help. Here's the one for this issue: https://github.com/mickael-menu/zk/blob/main/tests/issue-47.tesh

You can install tesh if you want to try it, but it's not necessary. As you can see a tesh file is just a list of shell command and the expected output. The cd issue-47 goes into this fixture folder: https://github.com/mickael-menu/zk/tree/main/tests/fixtures/issue-47

danymat commented 1 year ago

Ok so I think I have the culprit, and it seems to be macOS. I still cannot know the root reason of it, but I tried running the 0.13 version on a Debian based machine on my personal wiki, without any worries. Running the same for my M1 silicon on Ventura 13.3.1 gives inconsistent and false returns.

Maybe this bit of information can help more in finding the root cause. Do not hesitate to ask for more information, I will gladly respond to it

mickael-menu commented 1 year ago

Basically same as my previous message, if you can come up with .tesh file that exhibits the problem on macOS, that would be helpful.