sugar: http and gemini link are understood without the go command

This commit is contained in:
Lionel Dricot 2021-12-16 16:09:54 +01:00
parent 8ede39dd4d
commit 77ce33173e
2 changed files with 5 additions and 1 deletions

View File

@ -19,7 +19,6 @@ Known issues in the code:
* TODO: number of cache updated in blackbox
* TODO: dont add to tour when sync from tour/to_fetch
* TODO: https:// gemini:// should be understood without go
This is a fork of the original [AV-98](https://tildegit.org/solderpunk/AV-98)
by Solderpunk.

View File

@ -381,6 +381,7 @@ class GeminiClient(cmd.Cmd):
elif self.offline_only and self.options.get("offline_web"):
offline_browser = self.options.get("offline_web")
cmd = offline_browser % gi.url
print("Save for offline web :%s" %gi.url)
#FIXME : subprocess doesnt understand shell redirection
os.system(cmd)
return
@ -1215,6 +1216,10 @@ you'll be able to transparently follow links to Gopherspace!""")
return self.do_up()
elif line.startswith("/"):
return self.do_search(line[1:])
elif line.startswith("http://") or line.startswith("https://"):
return self.do_go(line)
elif line.startswith("gemini://"):
return self.do_go(line)
# Expand abbreviated commands
first_word = line.split()[0].strip()