Fix typo.

This commit is contained in:
Brent Simmons 2024-04-15 22:26:58 -07:00
parent 1368f3dace
commit df6c4bedb3
2 changed files with 4 additions and 4 deletions

@ -48,15 +48,15 @@ extension Article {
} }
var url: URL? { var url: URL? {
return URL.reparingIfRequired(rawLink) return URL.repairingIfRequired(rawLink)
} }
var externalURL: URL? { var externalURL: URL? {
return URL.reparingIfRequired(rawExternalLink) return URL.repairingIfRequired(rawExternalLink)
} }
var imageURL: URL? { var imageURL: URL? {
return URL.reparingIfRequired(rawImageLink) return URL.repairingIfRequired(rawImageLink)
} }
var link: String? { var link: String? {

@ -39,7 +39,7 @@ extension URL {
} }
static func reparingIfRequired(_ link: String?) -> URL? { static func repairingIfRequired(_ link: String?) -> URL? {
// If required, we replace any space characters to handle malformed links that are otherwise percent // If required, we replace any space characters to handle malformed links that are otherwise percent
// encoded but contain spaces. For performance reasons, only try this if initial URL init fails. // encoded but contain spaces. For performance reasons, only try this if initial URL init fails.
guard let link = link, !link.isEmpty else { return nil } guard let link = link, !link.isEmpty else { return nil }