From 54303bb5f87fe0ff0b894cd20d6e1c55c07d2194 Mon Sep 17 00:00:00 2001 From: sloumdrone Date: Thu, 27 Dec 2018 22:35:23 -0800 Subject: [PATCH] Added more standardized treament of html type linkages in gophermaps --- gui.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gui.py b/gui.py index dc8ae36..5e10f2a 100644 --- a/gui.py +++ b/gui.py @@ -279,7 +279,8 @@ class GUI: 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) return True element = event.widget @@ -402,8 +403,7 @@ class GUI: x['port'] = ':{}'.format(x['port']) if x['type'] == 'h': - link = '{}/{}'.format(x['host'], x['resource']) - link = 'http://{}'.format(link.replace('//','/')) + link = 'gopher://{}/{}'.format(x['host'], x['resource']) else: link = 'gopher://{}{}/{}{}'.format(x['host'], x['port'], x['type'], x['resource'])