render images inline - gopherproxy-c - Gopher HTTP proxy in C (CGI) | |
git clone git://git.codemadness.org/gopherproxy-c | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 4c9fcc17502735ad031ee12215fb441c2c27a42f | |
parent e96ccc93928250ede30995cff7bf0e11758b2602 | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Wed, 9 Jul 2025 19:34:43 +0200 | |
render images inline | |
Patch by kroovy <[email protected]>: | |
gopher://kroovy.de/1/phlog/inline-images-patch.gph | |
With some modifications. | |
Diffstat: | |
M gopherproxy.c | 14 +++++++++++++- | |
1 file changed, 13 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/gopherproxy.c b/gopherproxy.c | |
@@ -388,6 +388,18 @@ servedir(const char *server, const char *port, const char … | |
xmlencode(v.username); | |
fputs("</a>", stdout); | |
break; | |
+ case 'I': /* image: show inline */ | |
+ fputs(typestr(v._type), stdout); | |
+ fputs(" <a href=\"?q=", stdout); | |
+ encodeparam(uri); | |
+ fputs("\">", stdout); | |
+ | |
+ fputs("<img src=\"?q=", stdout); | |
+ encodeparam(uri); | |
+ fputs("\" width=\"400\">", stdout); | |
+ | |
+ fputs("</a>", stdout); | |
+ break; | |
default: /* other */ | |
fputs(typestr(v._type), stdout); | |
fputs(" <a href=\"", stdout); | |
@@ -731,7 +743,7 @@ main(void) | |
fputs( | |
"Gopher HTTP proxy</title>\n" | |
"<style type=\"text/css\">\n" | |
- "a { text-decoration: none; } a:hover { text-decoration: under… | |
+ "a { text-decoration: none; } a:hover { text-decoration: under… | |
"@media (prefers-color-scheme: dark) { body { background-color… | |
"</style>\n" | |
"<meta name=\"robots\" content=\"noindex, nofollow\" />\n" |