diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-06-16 18:35:29 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-06-17 11:07:24 +0300 |
commit | b4699418195cd7d6057aeef256ed2fc824f3862d (patch) | |
tree | 37ca3fb9ce903cf76a6414eec0d0e69326a38cbb /src/ui/documentwidget.c | |
parent | 926033f1890abc0d29145cf0ee145d2132eafafd (diff) |
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.
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r-- | src/ui/documentwidget.c | 6 |
1 files changed, 4 insertions, 2 deletions
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, | |||
1469 | linkTitle = | 1469 | linkTitle = |
1470 | baseName_Path(collect_String(newRange_String(parts.path))).start; | 1470 | baseName_Path(collect_String(newRange_String(parts.path))).start; |
1471 | } | 1471 | } |
1472 | format_String(&str, "=> %s %s\n", cstr_String(d->mod.url), linkTitle); | 1472 | format_String(&str, "=> %s %s\n", |
1473 | cstr_String(withSpacesEncoded_String(d->mod.url)), | ||
1474 | linkTitle); | ||
1473 | setData_Media(media_GmDocument(d->doc), | 1475 | setData_Media(media_GmDocument(d->doc), |
1474 | imgLinkId, | 1476 | imgLinkId, |
1475 | mimeStr, | 1477 | mimeStr, |
@@ -4092,7 +4094,7 @@ static void drawRun_DrawContext_(void *context, const iGmRun *run) { | |||
4092 | } | 4094 | } |
4093 | #endif | 4095 | #endif |
4094 | /* Fill the background. */ { | 4096 | /* Fill the background. */ { |
4095 | if (run->linkId && linkFlags & isOpen_GmLinkFlag) { | 4097 | if (run->linkId && linkFlags & isOpen_GmLinkFlag && ~linkFlags & content_GmLinkFlag) { |
4096 | /* Open links get a highlighted background. */ | 4098 | /* Open links get a highlighted background. */ |
4097 | int bg = tmBackgroundOpenLink_ColorId; | 4099 | int bg = tmBackgroundOpenLink_ColorId; |
4098 | const int frame = tmFrameOpenLink_ColorId; | 4100 | const int frame = tmFrameOpenLink_ColorId; |