Skip to content

Conversation

Snapstromegon
Copy link

@Snapstromegon Snapstromegon commented Dec 12, 2021

Problem:
If the title of an entry contains a ".", the path becomes invalid.

Solution:
Replacing all "."s in the path using slugify resolves this problem.

Furthermore the following changes got made to simplify the code of sanitizePath:

  • Slugify automatically removes leading, trailing or doubled replacement chars, so doing it explicitly is just a no-op.
  • Also slugify has an option for converting to lower case.
Snapstromegon and others added 5 commits December 12, 2021 20:54
 Problem: If the title of an entry contains a ".", the path becomes invalid. Solution: Removing all "."s in the path using slugify resolves this problem. Furthermore the following changes got made to simplify the code of sanitizePath: - Slugify automatically removes leading, trailing or doubled replacement chars, so doing it explicitly is just a no-op. - Also slugify has an option for converting to lower case.
Signed-off-by: Raphael Höser <raphael@hoeser.info>
Signed-off-by: Raphael Höser <raphael@hoeser.info>
…efault char set Change the bahavior to replace dots instead of removing them Signed-off-by: Raphael Höser <raphael@hoeser.info>
@Snapstromegon Snapstromegon changed the title Remove "." from sanitizedPaths Sanitize "." in sanitizedPaths Dec 12, 2021
My solution was using replaceAll, but that isn't supported in node 12. Therefore I switched to regex for this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant