diff --git a/Tusker/Views/ContentTextView.swift b/Tusker/Views/ContentTextView.swift index 12195d63..3cef26e4 100644 --- a/Tusker/Views/ContentTextView.swift +++ b/Tusker/Views/ContentTextView.swift @@ -10,6 +10,8 @@ import UIKit import SwiftSoup import Pachyderm import SafariServices +import WebURL +import WebURLFoundationExtras private let emojiRegex = try! NSRegularExpression(pattern: ":(\\w+):", options: []) @@ -100,7 +102,8 @@ class ContentTextView: LinkTextView, BaseEmojiLabel { attributed.append(NSAttributedString(string: "\n")) case "a": if let link = try? node.attr("href"), - let url = URL(string: link) { + let webURL = WebURL(link), + let url = URL(webURL) { attributed.addAttribute(.link, value: url, range: attributed.fullRange) } case "p":