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

View file

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