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

when linking to local files remove ?fileID=123 #2136

Open
mstyp opened this issue Jan 27, 2022 · 3 comments
Open

when linking to local files remove ?fileID=123 #2136

mstyp opened this issue Jan 27, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@mstyp
Copy link

mstyp commented Jan 27, 2022

Is your feature request related to a problem? Please describe.
When creating a link to a local file, in the raw text of the file nextcloud makes it look like [click here to see link to file](filename.md?fileId=123). I have files synced across multiple nextcloud instances, and the file id changes depending on the instance, so the file link does not work. In addition, The markdown editor I use in android (markor) does not understand the ?fileId=123, and tries to make a whole new file.

The long and short of it is that I have no way to consistently link between files. I have to remember to use 4 different links, one that works on android and three others for the three different nextcloud instences the file is synced across, each with a different file id (but all living in the same place and with the same file structure).

Describe the solution you'd like
When linking to local files remove the ?fileId=123 part. The link should be based solely on the name of the file. so just [click here to see link to file](filename.md), which can be understood by markor and other nextcloud isntences

Describe alternatives you've considered
Cant think of any.

Additional context
cant think of any

@mstyp mstyp added the enhancement New feature or request label Jan 27, 2022
@max-nextcloud
Copy link
Collaborator

Hi @mstyp

Thanks for your bug report. We had not considered syncronisation between different nextcloud instances when designing the link structure. The idea behind including the file id is that relative paths might be different for different users.

Here's the scenario we had in mind:
Say i share two files with you that live in different folders for me say vacation/planning.md and vacation/locations/beach.md. The planning.md links to locations/beach.md but since the files were shared individually with you both files end up in you main folder.
There's a lot of other examples, why we cannot rely on relative paths within one nextcloud instance. So the idea was this... if it's a relative link - try to resolve it. If that fails - fall back to fileId which allows to retrieve any file you have access to on the same instance.

I see how fileIds are causing problems for you. Since they are only meant as a fallback they should not come into play on the different nextcloud instanced that are synced though. Could you elaborate on what is going on there?

Could you also check if markor behaves differently for parameters provided in the fragment of an url (filename.md#fileId=123)?

@mstyp
Copy link
Author

mstyp commented Feb 14, 2022

Could you also check if markor behaves differently for parameters provided in the fragment of an url (filename.md#fileId=123)?

In Markor, Changing from filename.md?fileId=123 to filename.md#fileId=123 does allow me to open the related file, but then the file cant be opened in nextcloudd.

To be honest I would rather not be using markor at all, I am sort of stuck doing so because of nextcloud/android#9771

Since they are only meant as a fallback they should not come into play on the different nextcloud instanced that are synced though. Could you elaborate on what is going on there?

Not at the moment. Currently only have access to local instance. Will add comment with details when I have access.

@phippodoplis
Copy link

filename.md#fileId=123 also works in emacs, but I would rather see it go. Your example looks a bit convoluted to me. I would expect that most uses of md files would be to have a folder structure that is the same relative to the base directory, and relative paths keep inside that hierarchy. If you start diverting directories within that hierarchy you can't really expect relative links to work at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants