Fixes gemini relative links to work for all relative link types #168
No reviewers
Labels
No Label
blocked
bug
build
documentation
duplicate
enhancement
finger
gemini
gopher
help wanted
http
in progress
invalid
local
needs-info
non-code
non-functional
non-urgent
question
release
rendering
suggestion
telnet
terminal
urgent
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sloum/bombadillo#168
Loading…
Reference in New Issue
No description provided.
Delete Branch "fix-relative-links"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Also adds comments to the
handleRelativeUrl
method to make this a little more clear next time someone needs to wade into these waters.This fix has been verified by testing:
This PR is intended to close #163
Can confirm it works, thanks!
Is there a reason why ResolveReference can't be used in all link cases to figure out the new path? This looks much simpler, but obviously I don't know much about how Bombadillo work internally (yet).
I did not know it existed :) I have not used the
net/url
stuff almost at all in this project other than at your suggestion.Bombadillo started primarily as, and continues to be, a learning project for me to explore things I was/am curious about (terminal handling, writing a terminal ui style application without ncurses, makefiles, etc) while ending up being something truly useful for me.
At work my boss is a big anti-nih (not-invented-here) guy. So as a result we barely write any code of our own and just string libraries together. I really do not like that kind of coding (it is useful for a business, but I dont learn much useful from it). So due to that my approach to bombadillo has often been to write... which is sometimes buggy, but I almost always learn something from it. That said, in a case like this I have no objection to leveraging something in the standard library.
I have rewritten the, now much much shorter, method for handling relative references leveraging the mentioned function. If you get a chance to give it a try and verify that it is working as you would expect I would greatly appreciate it!
Glad I was able to help! Just tried it out, it seems to work well but link 2 on your
test.gmi
page doesn't work. That's not the client but the page itself though, because a link like/spacewalk.gmi
will resolve torawtext.club/spacewalk.gmi
, which doesn't exist. Maybe change that link to/social_contract.gmi
?Cool! Glad to hear it worked. Nah, I'm gonna delete the doc. It was just a temp way to see changes. I never actually followed any links on the page so there was no need for them to be valid links (I just used
:check 2
, etc).