Fix UTF support for hashtags
Changelog-Fixed: Fix UTF support for hashtags Closes: https://github.com/damus-io/damus/issues/1411 Signed-off-by: Daniel D‘Aquino <daniel@daquino.me> Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
committed by
William Casarin
parent
ef5a3030a6
commit
cdc4a7b7a4
@@ -42,7 +42,7 @@ let custom_hashtags: [String: CustomHashtag] = [
|
|||||||
|
|
||||||
func hashtag_str(_ htag: String) -> CompatibleText {
|
func hashtag_str(_ htag: String) -> CompatibleText {
|
||||||
var attributedString = AttributedString(stringLiteral: "#\(htag)")
|
var attributedString = AttributedString(stringLiteral: "#\(htag)")
|
||||||
attributedString.link = URL(string: "damus:t:\(htag)")
|
attributedString.link = URL(string: "damus:t:\(htag.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? htag)")
|
||||||
|
|
||||||
let lowertag = htag.lowercased()
|
let lowertag = htag.lowercased()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user