Add support for `I' and `g' type (similar to non-standard `p') - gopher2html - AWK script that converts a Gopher response to HTML
HTML hg clone https://bitbucket.org/iamleot/gopher2html
DIR Log
DIR Files
DIR Refs
DIR README
---
DIR changeset 6194ea3e9b67a4758f1b58e2142950bb9aed3e89
DIR parent 942a89bf6b8ef51cf7ba661cba3c4eff6aa437f0
HTML Author: Leonardo Taccari <iamleot@gmail.com>
Date: Sat, 27 Jan 2018 14:38:16
Add support for `I' and `g' type (similar to non-standard `p')
Add support for `I' (TYPE["image"]) and `g' (TYPE["gif"]).
Both of them are documented in RFC 1436.
Diffstat:
gopher2html.awk | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff -r 942a89bf6b8e -r 6194ea3e9b67 gopher2html.awk
--- a/gopher2html.awk Wed Jan 24 10:10:33 2018 +0100
+++ b/gopher2html.awk Sat Jan 27 14:38:16 2018 +0100
@@ -49,6 +49,8 @@
TYPE["directory"] = "1"
TYPE["error"] = "3"
TYPE["search"] = "7"
+ TYPE["image"] = "I"
+ TYPE["gif"] = "g"
TYPE["html"] = "h"
TYPE["info"] = "i"
TYPE["picture"] = "p"
@@ -103,7 +105,7 @@
printf("<a href=\"%s\">%s</a>\n", encode(url), encode(user_name))
}
-type == TYPE["picture"] {
+type == TYPE["image"] || type == TYPE["gif"] || type == TYPE["picture"] {
printf("<img src=\"%s\" alt=\"%s\" />\n",
urlize(type, selector, host, port), encode(user_name))
}