summaryrefslogtreecommitdiff
path: root/src/ui/linkinfo.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2022-02-07 10:52:57 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2022-02-07 10:52:57 +0200
commit5be7f76e30f6655f82a677b73c7fcea4feeda42d (patch)
tree73423d8ef54ef72c517511e54ffdfa99c7f64750 /src/ui/linkinfo.c
parente9b2b0fa360c1802ca05f744e85702e8a0a98cd0 (diff)
GmDocument: Handling images in "data:" URLs
One can embed arbitrary data inside a "data:" URL. If an image is recognized, attempt to show it as part of the document.
Diffstat (limited to 'src/ui/linkinfo.c')
-rw-r--r--src/ui/linkinfo.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ui/linkinfo.c b/src/ui/linkinfo.c
index 5102f9b3..8974a486 100644
--- a/src/ui/linkinfo.c
+++ b/src/ui/linkinfo.c
@@ -91,6 +91,14 @@ void infoText_LinkInfo(const iGmDocument *doc, iGmLinkId linkId, iString *text_o
91 appendCStr_String(text_out, "\x1b[0m"); 91 appendCStr_String(text_out, "\x1b[0m");
92 appendRange_String(text_out, (iRangecc){ parts.path.start, constEnd_String(url) }); 92 appendRange_String(text_out, (iRangecc){ parts.path.start, constEnd_String(url) });
93 } 93 }
94 else if (scheme == data_GmLinkScheme) {
95 appendCStr_String(text_out, "\U0001f4e6 ");
96 const char *comma = strchr(cstr_String(url), ',');
97 if (!comma) {
98 comma = iMin(constEnd_String(url), constBegin_String(url) + 256);
99 }
100 appendRange_String(text_out, (iRangecc){ constBegin_String(url), comma });
101 }
94 else if (scheme != gemini_GmLinkScheme) { 102 else if (scheme != gemini_GmLinkScheme) {
95 appendCStr_String(text_out, scheme == file_GmLinkScheme ? "" : globe_Icon " "); 103 appendCStr_String(text_out, scheme == file_GmLinkScheme ? "" : globe_Icon " ");
96 append_String(text_out, url); 104 append_String(text_out, url);