From 6fffe250c28a1ee2c84f6b95c316b543c3e3a5e7 Mon Sep 17 00:00:00 2001 From: gladiusKatana Date: Mon, 13 Mar 2023 00:02:57 -0400 Subject: [PATCH] Fix some links getting interpreted as images Changelog-Fixed: Fix some links getting interpreted as images Closes: #774 Fixes: #766 --- damus/Views/NoteContentView.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/damus/Views/NoteContentView.swift b/damus/Views/NoteContentView.swift index b14c0364..6497c10a 100644 --- a/damus/Views/NoteContentView.swift +++ b/damus/Views/NoteContentView.swift @@ -240,7 +240,8 @@ func render_blocks(blocks: [Block], profiles: Profiles, privkey: String?) -> Not func is_image_url(_ url: URL) -> Bool { let str = url.lastPathComponent.lowercased() - return str.hasSuffix("png") || str.hasSuffix("jpg") || str.hasSuffix("jpeg") || str.hasSuffix("gif") + let isUrl = str.hasSuffix(".png") || str.hasSuffix(".jpg") || str.hasSuffix(".jpeg") || str.hasSuffix(".gif") + return isUrl } func lookup_cached_preview_size(previews: PreviewCache, evid: String) -> CGFloat? {