From b4699418195cd7d6057aeef256ed2fc824f3862d 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 599e7ef3..7f8d70a3 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -1469,7 +1469,9 @@ static void updateDocument_DocumentWidget_(iDocumentWidget *d, 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, @@ -4092,7 +4094,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