diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gmdocument.c | 1 | ||||
-rw-r--r-- | src/gmutil.c | 16 | ||||
-rw-r--r-- | src/ui/labelwidget.c | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c index 77f10c61..3cf00a4b 100644 --- a/src/gmdocument.c +++ b/src/gmdocument.c | |||
@@ -195,6 +195,7 @@ static iRangecc addLink_GmDocument_(iGmDocument *d, iRangecc line, iGmLinkId *li | |||
195 | link->flags |= file_GmLinkFlag; | 195 | link->flags |= file_GmLinkFlag; |
196 | } | 196 | } |
197 | else if (equalCase_Rangecc(parts.scheme, "data")) { | 197 | else if (equalCase_Rangecc(parts.scheme, "data")) { |
198 | link->flags |= data_GmLinkFlag; | ||
198 | } | 199 | } |
199 | else if (equalCase_Rangecc(parts.scheme, "about")) { | 200 | else if (equalCase_Rangecc(parts.scheme, "about")) { |
200 | link->flags |= about_GmLinkFlag; | 201 | link->flags |= about_GmLinkFlag; |
diff --git a/src/gmutil.c b/src/gmutil.c index 8dcffaa1..b7ddfa21 100644 --- a/src/gmutil.c +++ b/src/gmutil.c | |||
@@ -95,7 +95,14 @@ void stripDefaultUrlPort_String(iString *d) { | |||
95 | } | 95 | } |
96 | } | 96 | } |
97 | 97 | ||
98 | iBool isDataUrl_String(const iString *d) { | ||
99 | return startsWithCase_String(d, "data:"); | ||
100 | } | ||
101 | |||
98 | const iString *urlFragmentStripped_String(const iString *d) { | 102 | const iString *urlFragmentStripped_String(const iString *d) { |
103 | if (isDataUrl_String(d)) { | ||
104 | return d; | ||
105 | } | ||
99 | /* Note: Could use `iUrl` here and leave out the fragment. */ | 106 | /* Note: Could use `iUrl` here and leave out the fragment. */ |
100 | const size_t fragPos = indexOf_String(d, '#'); | 107 | const size_t fragPos = indexOf_String(d, '#'); |
101 | if (fragPos != iInvalidPos) { | 108 | if (fragPos != iInvalidPos) { |
@@ -227,6 +234,9 @@ void urlDecodePath_String(iString *d) { | |||
227 | void urlEncodePath_String(iString *d) { | 234 | void urlEncodePath_String(iString *d) { |
228 | iUrl url; | 235 | iUrl url; |
229 | init_Url(&url, d); | 236 | init_Url(&url, d); |
237 | if (equalCase_Rangecc(url.scheme, "data")) { | ||
238 | return; | ||
239 | } | ||
230 | if (isEmpty_Range(&url.path)) { | 240 | if (isEmpty_Range(&url.path)) { |
231 | return; | 241 | return; |
232 | } | 242 | } |
@@ -355,6 +365,9 @@ void punyEncodeDomain_Rangecc(iRangecc domain, iString *encoded_out) { | |||
355 | void punyEncodeUrlHost_String(iString *absoluteUrl) { | 365 | void punyEncodeUrlHost_String(iString *absoluteUrl) { |
356 | iUrl url; | 366 | iUrl url; |
357 | init_Url(&url, absoluteUrl); | 367 | init_Url(&url, absoluteUrl); |
368 | if (equalCase_Rangecc(url.scheme, "data")) { | ||
369 | return; | ||
370 | } | ||
358 | if (isEmpty_Range(&url.host)) { | 371 | if (isEmpty_Range(&url.host)) { |
359 | return; | 372 | return; |
360 | } | 373 | } |
@@ -391,6 +404,9 @@ void urlEncodeSpaces_String(iString *d) { | |||
391 | } | 404 | } |
392 | 405 | ||
393 | const iString *withSpacesEncoded_String(const iString *d) { | 406 | const iString *withSpacesEncoded_String(const iString *d) { |
407 | if (isDataUrl_String(d)) { | ||
408 | return d; | ||
409 | } | ||
394 | iString *enc = copy_String(d); | 410 | iString *enc = copy_String(d); |
395 | urlEncodeSpaces_String(enc); | 411 | urlEncodeSpaces_String(enc); |
396 | return collect_String(enc); | 412 | return collect_String(enc); |
diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c index 8089445b..6e8208c4 100644 --- a/src/ui/labelwidget.c +++ b/src/ui/labelwidget.c | |||
@@ -305,6 +305,7 @@ static void draw_LabelWidget_(const iLabelWidget *d) { | |||
305 | adjusted_Rect(bounds, init_I2(iconPad, 0), zero_I2()), | 305 | adjusted_Rect(bounds, init_I2(iconPad, 0), zero_I2()), |
306 | d->alignVisual, | 306 | d->alignVisual, |
307 | fg, | 307 | fg, |
308 | "%s", | ||
308 | cstr_String(&d->label)); | 309 | cstr_String(&d->label)); |
309 | } | 310 | } |
310 | if (flags & chevron_WidgetFlag) { | 311 | if (flags & chevron_WidgetFlag) { |