fix many small bugs

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2022-06-09 11:40:41 -07:00
parent 12785ec4a0
commit e104de6431
11 changed files with 40 additions and 50 deletions

View File

@@ -81,7 +81,8 @@ func parse_nostr_ref_uri(_ p: Parser) -> ReferencedId? {
}
func decode_nostr_uri(_ s: String) -> NostrLink? {
let uri = s.replacingOccurrences(of: "nostr:", with: "")
var uri = s.replacingOccurrences(of: "nostr://", with: "")
uri = uri.replacingOccurrences(of: "nostr:", with: "")
let parts = uri.split(separator: ":")
.reduce(into: Array<String>()) { acc, str in
@@ -93,7 +94,7 @@ func decode_nostr_uri(_ s: String) -> NostrLink? {
}
if parts.count >= 2 && parts[0] == "hashtag" {
return .filter(NostrFilter.filter_hashtag([parts[1]]))
return .filter(NostrFilter.filter_hashtag([parts[1].lowercased()]))
}
return tag_to_refid(parts).map { .ref($0) }