Make links clickable in follow user view

This commit is contained in:
Lionello Lunesu
2022-12-28 23:01:40 -08:00
parent 75c67bc1e9
commit a4eaa50ba7
4 changed files with 12 additions and 17 deletions

View File

@@ -15,7 +15,7 @@ public struct Markdown {
return url.contains("://") ? url : "https://" + url
}
static func parseMarkdown(content: String) -> AttributedString {
public static func parse(content: String) -> AttributedString {
// Similar to the parsing in NoteContentView
let md_opts: AttributedString.MarkdownParsingOptions =
.init(interpretedSyntax: .inlineOnlyPreservingWhitespace)
@@ -38,6 +38,6 @@ public struct Markdown {
output.replaceSubrange(range, with: "[\(url)](\(Markdown.withScheme(url)))")
}
// TODO: escape unintentional markdown
return Markdown.parseMarkdown(content: output)
return Markdown.parse(content: output)
}
}