-
Notifications
You must be signed in to change notification settings - Fork 186
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
Relative links/URLs don't open correctly #1605
Comments
Hint: You can see a fix to a similar problem here: newsboat/newsboat#1818. |
Yea I don't think this is something that can be "fixed", it is not a good practice to include relative links in the feed content as the feed is usually not read on the website itself. To solve this I guess that news would need to check and modify every URL in the feed if it is relative to adjust it to an absolute (guessed) URL and save the modified content to the dB. So that clients get the absolute path. This might also impact performance heavily. Maybe the feed author also wants it that way so that you have to manually go to the website.. . |
Actually I think it is fine to fix the urls at the client level: modifying the db makes mistakes more difficult to fix later. For now just the browser code needs to be modified, and later other clients can also fix the problem in their own projects (if they haven't already). This means that one only need to fix the urls in the current message as it opens: not very intensive. Probably there is even some logic going on anyway to determine how to display the links, which can simply be modified to fix relative links on the go. While absolute paths might be more ideal in an rss feed, I believe having relative links is not something which can be easily avoided and is somewhat justified: many people when writing the rss feeds for their websites would simply copy and paste the html code from their website (because you can insert html in rss so it is convenient). Relative links in websites is actually a good practice, but unfortunately this ends up getting carried on to the rss, leading to this mess. Modifying the links when moving them to rss is not something everyone is going to think of, is easy to miss at places, and might actually take some good amount of manual effort (if the feed is written by hand for example). However, once one understands where the problem is originating from, it can be easily dealt with. Relative links simply need to be treated as if they exist on the main article. In the case of newsboat, all it took is one additional if statement (literally two lines of code): newsboat/newsboat#1823. |
Hmm yea true the clients could also handle it. I don't work on the front-end though no idea. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
IMPORTANT
Read and tick the following checkbox after you have created the issue or place an x inside the brackets ;)
Explain the Problem
What problem did you encounter?
Relative links are handled as if they are relative to the news app, whereas they should be relative to the article's url.
Steps to Reproduce
Explain what you did to encounter the issue
Example article URL: https://lukesmith.xyz/articles/matrix-vs-xmpp.html
1st link (target): ../pix/xmpp.svg
Expected behaviour: The relative link is appended to the article's URL to give https://lukesmith.xyz/pix/xmpp.svg
Actual behaviour: The relative link is appended to the news app's URL to give https://cloud.farzat.xyz/apps/pix/xmpp.svg
System Information
Contents of nextcloud/data/nextcloud.log
Paste output here
Contents of Browser Error Console
Read http://ggnome.com/wiki/Using_The_Browser_Error_Console if you are unsure what to put hereThe text was updated successfully, but these errors were encountered: