diff options
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r-- | src/gmdocument.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c index 1f8ecb75..8d2e3f1f 100644 --- a/src/gmdocument.c +++ b/src/gmdocument.c | |||
@@ -177,8 +177,9 @@ static iRangecc addLink_GmDocument_(iGmDocument *d, iRangecc line, iGmLinkId *li | |||
177 | else if (startsWithCase_Rangecc(parts.scheme, "http")) { | 177 | else if (startsWithCase_Rangecc(parts.scheme, "http")) { |
178 | link->flags |= http_GmLinkFlag; | 178 | link->flags |= http_GmLinkFlag; |
179 | } | 179 | } |
180 | else if (equalCase_Rangecc(parts.scheme, "gopher")) { | 180 | else if (equalCase_Rangecc(parts.scheme, "gopher") || |
181 | link->flags |= gopher_GmLinkFlag; | 181 | equalCase_Rangecc(parts.scheme, "finger")) { |
182 | link->flags |= gopher_finger_GmLinkFlag; | ||
182 | if (startsWith_Rangecc(parts.path, "/7")) { | 183 | if (startsWith_Rangecc(parts.path, "/7")) { |
183 | link->flags |= query_GmLinkFlag; | 184 | link->flags |= query_GmLinkFlag; |
184 | } | 185 | } |
@@ -187,7 +188,6 @@ static iRangecc addLink_GmDocument_(iGmDocument *d, iRangecc line, iGmLinkId *li | |||
187 | link->flags |= file_GmLinkFlag; | 188 | link->flags |= file_GmLinkFlag; |
188 | } | 189 | } |
189 | else if (equalCase_Rangecc(parts.scheme, "data")) { | 190 | else if (equalCase_Rangecc(parts.scheme, "data")) { |
190 | link->flags |= data_GmLinkFlag; | ||
191 | } | 191 | } |
192 | else if (equalCase_Rangecc(parts.scheme, "about")) { | 192 | else if (equalCase_Rangecc(parts.scheme, "about")) { |
193 | link->flags |= about_GmLinkFlag; | 193 | link->flags |= about_GmLinkFlag; |
@@ -245,7 +245,8 @@ static iBool isForcedMonospace_GmDocument_(const iGmDocument *d) { | |||
245 | if (equalCase_Rangecc(scheme, "gemini")) { | 245 | if (equalCase_Rangecc(scheme, "gemini")) { |
246 | return prefs_App()->monospaceGemini; | 246 | return prefs_App()->monospaceGemini; |
247 | } | 247 | } |
248 | if (equalCase_Rangecc(scheme, "gopher")) { | 248 | if (equalCase_Rangecc(scheme, "gopher") || |
249 | equalCase_Rangecc(scheme, "finger")) { | ||
249 | return prefs_App()->monospaceGopher; | 250 | return prefs_App()->monospaceGopher; |
250 | } | 251 | } |
251 | return iFalse; | 252 | return iFalse; |
@@ -1373,24 +1374,24 @@ enum iColorId linkColor_GmDocument(const iGmDocument *d, iGmLinkId linkId, enum | |||
1373 | if (link->flags & visited_GmLinkFlag) { | 1374 | if (link->flags & visited_GmLinkFlag) { |
1374 | return link->flags & www_GmLinkFlag | 1375 | return link->flags & www_GmLinkFlag |
1375 | ? tmHypertextLinkIconVisited_ColorId | 1376 | ? tmHypertextLinkIconVisited_ColorId |
1376 | : link->flags & gopher_GmLinkFlag ? tmGopherLinkIconVisited_ColorId | 1377 | : link->flags & gopher_finger_GmLinkFlag ? tmGopherLinkIconVisited_ColorId |
1377 | : tmLinkIconVisited_ColorId; | 1378 | : tmLinkIconVisited_ColorId; |
1378 | } | 1379 | } |
1379 | return link->flags & www_GmLinkFlag | 1380 | return link->flags & www_GmLinkFlag |
1380 | ? tmHypertextLinkIcon_ColorId | 1381 | ? tmHypertextLinkIcon_ColorId |
1381 | : link->flags & gopher_GmLinkFlag ? tmGopherLinkIcon_ColorId | 1382 | : link->flags & gopher_finger_GmLinkFlag ? tmGopherLinkIcon_ColorId |
1382 | : tmLinkIcon_ColorId; | 1383 | : tmLinkIcon_ColorId; |
1383 | } | 1384 | } |
1384 | if (part == text_GmLinkPart) { | 1385 | if (part == text_GmLinkPart) { |
1385 | return link->flags & www_GmLinkFlag | 1386 | return link->flags & www_GmLinkFlag |
1386 | ? tmHypertextLinkText_ColorId | 1387 | ? tmHypertextLinkText_ColorId |
1387 | : link->flags & gopher_GmLinkFlag ? tmGopherLinkText_ColorId | 1388 | : link->flags & gopher_finger_GmLinkFlag ? tmGopherLinkText_ColorId |
1388 | : tmLinkText_ColorId; | 1389 | : tmLinkText_ColorId; |
1389 | } | 1390 | } |
1390 | if (part == textHover_GmLinkPart) { | 1391 | if (part == textHover_GmLinkPart) { |
1391 | return link->flags & www_GmLinkFlag | 1392 | return link->flags & www_GmLinkFlag |
1392 | ? tmHypertextLinkTextHover_ColorId | 1393 | ? tmHypertextLinkTextHover_ColorId |
1393 | : link->flags & gopher_GmLinkFlag ? tmGopherLinkTextHover_ColorId | 1394 | : link->flags & gopher_finger_GmLinkFlag ? tmGopherLinkTextHover_ColorId |
1394 | : tmLinkTextHover_ColorId; | 1395 | : tmLinkTextHover_ColorId; |
1395 | } | 1396 | } |
1396 | if (part == domain_GmLinkPart) { | 1397 | if (part == domain_GmLinkPart) { |
@@ -1399,13 +1400,13 @@ enum iColorId linkColor_GmDocument(const iGmDocument *d, iGmLinkId linkId, enum | |||
1399 | } | 1400 | } |
1400 | return link->flags & www_GmLinkFlag | 1401 | return link->flags & www_GmLinkFlag |
1401 | ? tmHypertextLinkDomain_ColorId | 1402 | ? tmHypertextLinkDomain_ColorId |
1402 | : link->flags & gopher_GmLinkFlag ? tmGopherLinkDomain_ColorId | 1403 | : link->flags & gopher_finger_GmLinkFlag ? tmGopherLinkDomain_ColorId |
1403 | : tmLinkDomain_ColorId; | 1404 | : tmLinkDomain_ColorId; |
1404 | } | 1405 | } |
1405 | if (part == visited_GmLinkPart) { | 1406 | if (part == visited_GmLinkPart) { |
1406 | return link->flags & www_GmLinkFlag | 1407 | return link->flags & www_GmLinkFlag |
1407 | ? tmHypertextLinkLastVisitDate_ColorId | 1408 | ? tmHypertextLinkLastVisitDate_ColorId |
1408 | : link->flags & gopher_GmLinkFlag ? tmGopherLinkLastVisitDate_ColorId | 1409 | : link->flags & gopher_finger_GmLinkFlag ? tmGopherLinkLastVisitDate_ColorId |
1409 | : tmLinkLastVisitDate_ColorId; | 1410 | : tmLinkLastVisitDate_ColorId; |
1410 | } | 1411 | } |
1411 | } | 1412 | } |
@@ -1416,6 +1417,7 @@ iBool isMediaLink_GmDocument(const iGmDocument *d, iGmLinkId linkId) { | |||
1416 | const iString *dstUrl = absoluteUrl_String(&d->url, linkUrl_GmDocument(d, linkId)); | 1417 | const iString *dstUrl = absoluteUrl_String(&d->url, linkUrl_GmDocument(d, linkId)); |
1417 | const iRangecc scheme = urlScheme_String(dstUrl); | 1418 | const iRangecc scheme = urlScheme_String(dstUrl); |
1418 | if (equalCase_Rangecc(scheme, "gemini") || equalCase_Rangecc(scheme, "gopher") || | 1419 | if (equalCase_Rangecc(scheme, "gemini") || equalCase_Rangecc(scheme, "gopher") || |
1420 | equalCase_Rangecc(scheme, "finger") || | ||
1419 | equalCase_Rangecc(scheme, "file") || willUseProxy_App(scheme)) { | 1421 | equalCase_Rangecc(scheme, "file") || willUseProxy_App(scheme)) { |
1420 | return (linkFlags_GmDocument(d, linkId) & | 1422 | return (linkFlags_GmDocument(d, linkId) & |
1421 | (imageFileExtension_GmLinkFlag | audioFileExtension_GmLinkFlag)) != 0; | 1423 | (imageFileExtension_GmLinkFlag | audioFileExtension_GmLinkFlag)) != 0; |