wiki-v1 icon indicating copy to clipboard operation
wiki-v1 copied to clipboard

Why wiki.js changes underscores to dashes when files are uploaded?

Open Rogach opened this issue 7 years ago • 6 comments

Actual behavior

I upload a_b.png - get a-b.png.

Expected behavior

Expected to have a_b.png in my file list.

Rogach avatar Nov 05 '17 10:11 Rogach

Also, other name mangling happens - s24 becomes s-24. Since I'm uploading lab project files to wiki, I need to keep names clean, and I use combination of various numbers, underscores, and dashes - changing underscores to dashes really screws everything up.

Rogach avatar Nov 05 '17 10:11 Rogach

Because Wiki.js relies on kebab-case filenames to read and write data.

I'll think of a solution for 2.0 to get around this limitation.

NGPixel avatar Nov 12 '17 23:11 NGPixel

Yes, that I understood. But was there any reason for that kebab-case? Manually uploading the files and setting proper names in the links works without any problems.

Rogach avatar Nov 12 '17 23:11 Rogach

Non-technical users are really bad at using proper file naming. They include spaces, accents and other non url friendly characters, which is why all filenames go through a kebab-case conversion first.

NGPixel avatar Nov 12 '17 23:11 NGPixel

Okay, I can understand that non-url-friendly characters are bad, but adding dashes between letters and numbers and replacing underscores seems a little too much.

Also, why force url-friendliness at all? There will always be non-latin languages, which are completely url-unfriendly (all or almost all characters are encoded). Maybe it is easier to just leave all the names as-is?

Rogach avatar Nov 12 '17 23:11 Rogach

Any traction on this? This makes building any cohesion between folder structure and updates very difficult. As an example, I use this to track my cloud tenants, and there's a 4 character identifier that is unique to the tenant. My folder structure is broken down by that ID, which is great. But managing them in GIT is a pain because of all the oddly placed " - " between the 4 characters

julsoj avatar Jan 20 '19 00:01 julsoj