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

Some links try to load invalid files #101

Open
wischi-chr opened this issue Feb 21, 2023 · 1 comment
Open

Some links try to load invalid files #101

wischi-chr opened this issue Feb 21, 2023 · 1 comment

Comments

@wischi-chr
Copy link

My markdown files already have relative links because most of the time when I'm editing them I'm using VS Code and similar tools. If I click on links that reference another markdown file the extension will be added twice and the page fails to load.

for example if I have a link like this [Some random text](OtherFile.md) it will generate a URL that ends with /OtherFile.md but that page than tries to load /OtherFile.md.md

Other cases would be files that seem to be supported but are not .md files, for example like .txt and .ini. Those files are listed (on the /list pages) but when I click them the URL is generated without the extension and than the page tries to load an .md file that doesn't exist.

My guess is that originally one wanted to keep the wiki URLs clean and without extensions but that seems to break in a lot of cases.

At this point I think there would be two options to solve those issues:

  1. Always just use the original filename including extension in the URL. This would be simple and straight forward but the URLs would be a bit less clean.
  2. Another solution would be to change the way files are looked up. First check the URL if it already points to a valid file and if not try other extensions. So if I open /Folder/PageA test if there really is a file without extension and open that. If there is not try to append ".md" and test if that file exists. This would allow for clean URLs but fix the issues mentioned above.

I like Option 1 better and it would be the least surprising to users, but I guess there was a reason to drop the ".md" from the URLs in the first place.

@Linbreux
Copy link
Owner

Hi @wischi-chr thanks for the detailed review. I guess we could use option 1. I don't think there is a reason why we don't use the .md extension.

We could switch to that, although we should allow backward compatibility. Some users will have links referring to a file in the wiki like:

somefile links to somefile.md

So we could navigate to the link. If there is no file, try to remove suffix (like option2).

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

No branches or pull requests

2 participants