Fix space between mentions in status

This commit is contained in:
Thomas Ricouard 2022-12-22 07:00:22 +01:00
parent 05b5951ee1
commit cff6f3a843
1 changed files with 4 additions and 2 deletions

View File

@ -16,8 +16,10 @@ extension HTMLString {
public var asSafeAttributedString: AttributedString {
do {
// Add space between hashtags that follow each other
let markdown = asMarkdown.replacingOccurrences(of: ")[#", with: ") [#")
// Add space between hashtags and mentions that follow each other
let markdown = asMarkdown
.replacingOccurrences(of: ")[#", with: ") [#")
.replacingOccurrences(of: ")[@", with: ") [@")
let options = AttributedString.MarkdownParsingOptions(allowsExtendedAttributes: true,
interpretedSyntax: .inlineOnlyPreservingWhitespace)
return try AttributedString(markdown: markdown, options: options)