From 351cfaa26f11afad4d599a5ed5bfd0d2bbf3ba6e Mon Sep 17 00:00:00 2001 From: Luxferre Date: Sun, 6 Oct 2024 23:19:06 +0300 Subject: [PATCH] Improved Gopher entry support --- README.md | 2 +- bfg.tcl | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 753fd46..9bbcb30 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The following features are already (fully or partially) supported in BFG. * [Nex](https://nex.nightfall.city/nex/info/specification.txt) protocol (`nex://` URLs) * [Spartan](https://portal.mozz.us/spartan/spartan.mozz.us/specification.gmi) protocol (`spartan://` URLs) with single-line text query support * [Gemini](https://geminiprotocol.net/docs/) protocol (`gemini://` URLs) with single-line custom input support -* Gophermap rendering (entry types 0, 1, 3, 5, 7, 8, 9, i, h) +* Gophermap rendering (almost all known entry types) * Single-line search query support for Gopher type 7 resources * UTF-8 support for text content * Basic history support (back/forward actions) diff --git a/bfg.tcl b/bfg.tcl index 67a4cf1..de36907 100755 --- a/bfg.tcl +++ b/bfg.tcl @@ -589,7 +589,17 @@ proc render_handler_gopher {prevurl rooturl path body textw} { 0 - 1 - 5 - - 9 { # plain text, gophermap, binary + g - + I - + : - + ; - + < - + d - + p - + s - + P - + X - + 9 { # plain text, gophermap, binary, image, sound... linkinsert $textw $prevurl $rooturl "$tscheme://$rhost:$rport/$rtype$rsel" $rdesc "" preformatter } 7 { # gophermap with input @@ -613,7 +623,7 @@ proc render_handler_gopher {prevurl rooturl path body textw} { default {} } } - } elseif {($gophertype eq 5) || ($gophertype eq 9)} { + } elseif {($gophertype ne 0) && ($gophertype ne 3)} { $textw insert end $body preformatter } else { $textw insert end [textsanitize $body] preformatter