forked from shadowfacts/Tusker
Fix trailing whitespace not being stripped from compose reply content
This commit is contained in:
parent
b4bdf8b0dc
commit
a9a518c6c1
|
@ -28,8 +28,13 @@ struct ComposeReplyContentView: UIViewRepresentable {
|
||||||
view.adjustsFontForContentSizeCategory = true
|
view.adjustsFontForContentSizeCategory = true
|
||||||
|
|
||||||
view.overrideMastodonController = mastodonController
|
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
|
return view
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue