Fix TextConverter inserting newlines
This commit is contained in:
parent
4d183fe0b2
commit
93c859a3c4
|
@ -33,7 +33,7 @@ class StatusActivityItemSource: NSObject, UIActivityItemSource {
|
|||
let metadata = LPLinkMetadata()
|
||||
metadata.originalURL = status.url!
|
||||
metadata.url = status.url!
|
||||
var converter = TextConverter(callbacks: HTMLConverter.Callbacks.self)
|
||||
var converter = TextConverter(configuration: .init(insertNewlines: false), callbacks: HTMLConverter.Callbacks.self)
|
||||
let content = converter.convert(html: status.content)
|
||||
metadata.title = "\(status.account.displayName): \"\(content)\""
|
||||
if let avatar = status.account.avatar,
|
||||
|
|
|
@ -78,7 +78,7 @@ class TrendingLinkCardCollectionViewCell: UICollectionViewCell {
|
|||
let provider = card.providerName!.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
providerLabel.text = provider
|
||||
|
||||
var converter = TextConverter(callbacks: HTMLConverter.Callbacks.self)
|
||||
var converter = TextConverter(configuration: .init(insertNewlines: false), callbacks: HTMLConverter.Callbacks.self)
|
||||
descriptionLabel.text = converter.convert(html: card.description)
|
||||
descriptionLabel.isHidden = description.isEmpty
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ class ActionNotificationGroupCollectionViewCell: UICollectionViewListCell {
|
|||
|
||||
actionLabel.setEmojis(pairs: people.map { ($0.displayOrUserName, $0.emojis) }, identifier: group.id)
|
||||
|
||||
var converter = TextConverter(callbacks: HTMLConverter.Callbacks.self)
|
||||
var converter = TextConverter(configuration: .init(insertNewlines: false), callbacks: HTMLConverter.Callbacks.self)
|
||||
statusContentLabel.text = converter.convert(html: status.content)
|
||||
}
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ class PollFinishedNotificationCollectionViewCell: UICollectionViewListCell {
|
|||
updateTimestamp()
|
||||
updateDisplayName(account: account)
|
||||
|
||||
var converter = TextConverter(callbacks: HTMLConverter.Callbacks.self)
|
||||
var converter = TextConverter(configuration: .init(insertNewlines: false), callbacks: HTMLConverter.Callbacks.self)
|
||||
contentLabel.text = converter.convert(html: status.content)
|
||||
|
||||
pollView.mastodonController = mastodonController
|
||||
|
|
|
@ -120,7 +120,7 @@ class StatusUpdatedNotificationCollectionViewCell: UICollectionViewListCell {
|
|||
updateTimestamp()
|
||||
updateDisplayName(account: account)
|
||||
|
||||
var converter = TextConverter(callbacks: HTMLConverter.Callbacks.self)
|
||||
var converter = TextConverter(configuration: .init(insertNewlines: false), callbacks: HTMLConverter.Callbacks.self)
|
||||
contentLabel.text = converter.convert(html: status.content)
|
||||
}
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ class AccountCollectionViewCell: UICollectionViewListCell {
|
|||
displayNameLabel.setEmojis(account.emojis, identifier: account.id)
|
||||
}
|
||||
|
||||
var converter = TextConverter(callbacks: HTMLConverter.Callbacks.self)
|
||||
var converter = TextConverter(configuration: .init(insertNewlines: false), callbacks: HTMLConverter.Callbacks.self)
|
||||
noteLabel.text = converter.convert(html: account.note)
|
||||
noteLabel.setEmojis(account.emojis, identifier: account.id)
|
||||
}
|
||||
|
|
|
@ -191,7 +191,7 @@ class StatusCardView: UIView {
|
|||
titleLabel.text = title
|
||||
titleLabel.isHidden = title.isEmpty
|
||||
|
||||
var converter = TextConverter(callbacks: HTMLConverter.Callbacks.self)
|
||||
var converter = TextConverter(configuration: .init(insertNewlines: false), callbacks: HTMLConverter.Callbacks.self)
|
||||
let description = converter.convert(html: card.description)
|
||||
descriptionLabel.text = description
|
||||
descriptionLabel.isHidden = description.isEmpty
|
||||
|
|
Loading…
Reference in New Issue