Added more standardized treament of html type linkages in gophermaps

This commit is contained in:
sloumdrone 2018-12-27 22:35:23 -08:00
parent 71046e8ac6
commit 54303bb5f8
1 changed files with 3 additions and 3 deletions

6
gui.py
View File

@ -279,7 +279,8 @@ class GUI:
def gotolink(self, event, href, tag_name): def gotolink(self, event, href, tag_name):
if href[:4] == 'http': if href.find('URL:') >= 0:
href = href.split('URL:')[1]
wb.open(href, 2, True) wb.open(href, 2, True)
return True return True
element = event.widget element = event.widget
@ -402,8 +403,7 @@ class GUI:
x['port'] = ':{}'.format(x['port']) x['port'] = ':{}'.format(x['port'])
if x['type'] == 'h': if x['type'] == 'h':
link = '{}/{}'.format(x['host'], x['resource']) link = 'gopher://{}/{}'.format(x['host'], x['resource'])
link = 'http://{}'.format(link.replace('//','/'))
else: else:
link = 'gopher://{}{}/{}{}'.format(x['host'], x['port'], x['type'], x['resource']) link = 'gopher://{}{}/{}{}'.format(x['host'], x['port'], x['type'], x['resource'])