Improved Gopher entry support

This commit is contained in:
Luxferre
2024-10-06 23:19:06 +03:00
parent 6a0c127e1b
commit 351cfaa26f
2 changed files with 13 additions and 3 deletions
+1 -1
View File
@@ -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)
+12 -2
View File
@@ -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