Fix trailing whitespace not being stripped from compose reply content
This commit is contained in:
parent
b4bdf8b0dc
commit
a9a518c6c1
|
@ -28,7 +28,12 @@ struct ComposeReplyContentView: UIViewRepresentable {
|
|||
view.adjustsFontForContentSizeCategory = true
|
||||
|
||||
view.overrideMastodonController = mastodonController
|
||||
view.attributedText = TimelineStatusCollectionViewCell.htmlConverter.convert(status.content)
|
||||
let content = TimelineStatusCollectionViewCell.htmlConverter.convert(status.content)
|
||||
let collapsedContent = NSMutableAttributedString(attributedString: content)
|
||||
collapsedContent.collapseWhitespace()
|
||||
collapsedContent.trimLeadingCharactersInSet(.whitespacesAndNewlines)
|
||||
collapsedContent.trimTrailingCharactersInSet(.whitespacesAndNewlines)
|
||||
view.attributedText = collapsedContent
|
||||
|
||||
return view
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue