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-16 18:36:23 +0300 |
commit | 626cf01c7102b89f0ff352603f6b89f2aa9425c0 (patch) | |
tree | 26f5b176b135284babcfe175c313dad8480226bf /src/ui | |
parent | 30d0e46da7a5b45896cde2a965fef8574714bb5d (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')
-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 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 | |||
1432 | linkTitle = | 1432 | linkTitle = |
1433 | baseName_Path(collect_String(newRange_String(parts.path))).start; | 1433 | baseName_Path(collect_String(newRange_String(parts.path))).start; |
1434 | } | 1434 | } |
1435 | format_String(&str, "=> %s %s\n", cstr_String(d->mod.url), linkTitle); | 1435 | format_String(&str, "=> %s %s\n", |
1436 | cstr_String(withSpacesEncoded_String(d->mod.url)), | ||
1437 | linkTitle); | ||
1436 | setData_Media(media_GmDocument(d->doc), | 1438 | setData_Media(media_GmDocument(d->doc), |
1437 | imgLinkId, | 1439 | imgLinkId, |
1438 | mimeStr, | 1440 | mimeStr, |
@@ -3870,7 +3872,7 @@ static void drawRun_DrawContext_(void *context, const iGmRun *run) { | |||
3870 | } | 3872 | } |
3871 | #endif | 3873 | #endif |
3872 | /* Fill the background. */ { | 3874 | /* Fill the background. */ { |
3873 | if (run->linkId && linkFlags & isOpen_GmLinkFlag) { | 3875 | if (run->linkId && linkFlags & isOpen_GmLinkFlag && ~linkFlags & content_GmLinkFlag) { |
3874 | /* Open links get a highlighted background. */ | 3876 | /* Open links get a highlighted background. */ |
3875 | int bg = tmBackgroundOpenLink_ColorId; | 3877 | int bg = tmBackgroundOpenLink_ColorId; |
3876 | const int frame = tmFrameOpenLink_ColorId; | 3878 | const int frame = tmFrameOpenLink_ColorId; |