Linkify file URL

main
cel 5 years ago
parent da41589c94
commit deff461ed5
Signed by: cel
GPG Key ID: C28D95BB012367EA

@ -47,7 +47,7 @@ sd_autolink_issafe(const uint8_t *link, size_t link_len)
"@", "&", "%", "#",
"gemini://", "gopher://", "finger://",
"ytdl://",
"/", "http://", "https://", "ftp://", "mailto:"
"/", "http://", "https://", "ftp://", "mailto:", "file:///",
};
static const size_t valid_uris_count = sizeof(valid_uris)/sizeof(valid_uris[0]);
@ -298,7 +298,8 @@ sd_autolink__url(
size - link_end,
flags & SD_AUTOLINK_SHORT_DOMAINS);
if (domain_len == 0)
if (domain_len == 0 &&
!(size >= 5 && strncmp((const char *)data, "file:", 5)))
return 0;
link_end += domain_len;

Loading…
Cancel
Save