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

Fix: Allow special charaters in node titles #59

Merged
merged 3 commits into from
Dec 5, 2023

Conversation

falk-werner
Copy link
Owner

Instead of restricting the user to allowed file names, we should also allow special characters in note titles.
I think, the most restrictions come from windows file systems (see below).

I had two possible solutions in mind:

  • use URL encoding for node titles
  • save note titles somewhere else

The quickest solution and the one which is picked here is to use URL encoding. However, we do not encode every character but only special characters which are prohibited in file names (<, >, :, ", /, , |, ?, *) and the escape character (%). For decoding, a full URL decode is used. This is safe as long as all notes are created by note.py or any other tool which encodes file names the same way.

Another solution will be to store the full title somewhere else in the note's directory. Maybe some metadata.yml. We should try to keep the directory name an title in sync, but we are not forced to. This solution will take more effort but the metadata.yml might come in handy later, when other meta data should be stored (e.g. tags).

@hmlampe: Please let me know, which solution you prefer.

References:

@falk-werner falk-werner self-assigned this Nov 23, 2023
@falk-werner falk-werner linked an issue Nov 23, 2023 that may be closed by this pull request
@falk-werner falk-werner enabled auto-merge (rebase) November 23, 2023 18:59
Copy link
Collaborator

@hmlampe hmlampe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a test for this feature, is this okay with you?

@falk-werner falk-werner merged commit 3482d0a into main Dec 5, 2023
9 checks passed
@falk-werner falk-werner deleted the fix/58-slash-in-note-name branch December 5, 2023 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slash in note name
2 participants