From c1220f50af281ab999ab8d4fafb3d1c036791671 Mon Sep 17 00:00:00 2001 From: cr0bar Date: Mon, 10 Jul 2023 21:29:11 +0100 Subject: [PATCH] Handle percent encoding of colon for some hashtags --- damus/Nostr/NostrLink.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/damus/Nostr/NostrLink.swift b/damus/Nostr/NostrLink.swift index 5d44bac2..3a15894a 100644 --- a/damus/Nostr/NostrLink.swift +++ b/damus/Nostr/NostrLink.swift @@ -116,8 +116,12 @@ func decode_nostr_uri(_ s: String) -> NostrLink? { return decode_universal_link(s) } - var uri = s.replacingOccurrences(of: "nostr://", with: "") + var uri = s + uri = uri.replacingOccurrences(of: "nostr://", with: "") uri = uri.replacingOccurrences(of: "nostr:", with: "") + + // Fix for non-latin characters resulting in second colon being encoded + uri = uri.replacingOccurrences(of: "damus:t%3A", with: "t:") uri = uri.replacingOccurrences(of: "damus://", with: "") uri = uri.replacingOccurrences(of: "damus:", with: "")