From 626cf01c7102b89f0ff352603f6b89f2aa9425c0 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Wed, 16 Jun 2021 18:35:29 +0300 Subject: DocumentWidget: Spaces in image URL On a generated image page, the image link URL was not escaped so any spaces would cause it to be broken. These content links also should not use the background highlighting meant for links open in other tabs. --- src/ui/documentwidget.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/ui/documentwidget.c') diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 6184a75a..5480523c 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -1432,7 +1432,9 @@ static void updateDocument_DocumentWidget_(iDocumentWidget *d, const iGmResponse linkTitle = baseName_Path(collect_String(newRange_String(parts.path))).start; } - format_String(&str, "=> %s %s\n", cstr_String(d->mod.url), linkTitle); + format_String(&str, "=> %s %s\n", + cstr_String(withSpacesEncoded_String(d->mod.url)), + linkTitle); setData_Media(media_GmDocument(d->doc), imgLinkId, mimeStr, @@ -3870,7 +3872,7 @@ static void drawRun_DrawContext_(void *context, const iGmRun *run) { } #endif /* Fill the background. */ { - if (run->linkId && linkFlags & isOpen_GmLinkFlag) { + if (run->linkId && linkFlags & isOpen_GmLinkFlag && ~linkFlags & content_GmLinkFlag) { /* Open links get a highlighted background. */ int bg = tmBackgroundOpenLink_ColorId; const int frame = tmFrameOpenLink_ColorId; -- cgit v1.2.3