mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 15:22:39 +00:00
Update Riot/Utils/FormattedBodyParser.swift
Co-authored-by: SBiOSoftWhare <SBiOSoftWhare@users.noreply.github.com>
This commit is contained in:
parent
88df490608
commit
10ab22556f
1 changed files with 4 additions and 1 deletions
|
@ -46,7 +46,10 @@ final class FormattedBodyParser: NSObject {
|
|||
return nil
|
||||
}
|
||||
let urlString = String(formattedBody[urlRange])
|
||||
let content = (formattedBody as NSString).substring(with: result.range(at: 2))
|
||||
guard let contentRange = Range(result.range(at: 2), in: formattedBody) else {
|
||||
return nil
|
||||
}
|
||||
let content = String(formattedBody[contentRange])
|
||||
// ignore invalid urls
|
||||
guard let link = URL(string: urlString) else { return nil }
|
||||
// ignore other links
|
||||
|
|
Loading…
Reference in a new issue